How can a web page run a program on client's computer? - visual-studio

I developed a web software with Visual Studio. Within this web software when I click on a button, the user's computer should run an application given as an .exe file. This application is a console application and it needs to receive commandline parameters.
I've tried to run it with Javascript, but it was removed due to security issues.
Dim startInfo As New ProcessStartInfo("C:\ProgramAdres\Program.exe")
startInfo.WindowStyle = ProcessWindowStyle.Normal
startInfo.Arguments = "arguments"
Process.Start(startInfo)
This code successfuly runs the application, but on the server side. I need your help because I do not know ActiveXand don't know how to start.

Related

Unable to interact with Install Shield Wizard Windows installer

I'm trying to automate EXE installation using Appium driver. Taken AutomationID/Name/Classname from EXE installation wizard by using inspect tool. Its creating desktop session. But, it's unable to interact with Install Shield Wizard Windows installer. Getting error message like "An element could not be located on the page using the given search parameters".
Please provide any solution or suggestion to handle this issue.
AppiumDriver<RemoteWebElement> NotepadSession;
DesiredCapabilities appCapabilities = new DesiredCapabilities();
appCapabilities.setCapability("app", #"C:\Windows\System32\notepad.exe");
NotepadSession = new WindowsDriver<RemoteWebElement> (new URL("http://127.0.0.1:4723"), appCapabilities);
NotepadSession.FindElementByClassName("Edit").SendKeys("This is some text");
By using above code able to launch the notepad. But, Its not doing any action on it.
Referred

How can I debug a classic ASP page in Visual Studio 2019? [duplicate]

I have to debug a classic asp site being served by IIS 7 (windows 2008).
How can I do this? I have only worked with ASP.NET.
From an MSDN blog post: http://blogs.msdn.com/mikhailarkhipov/archive/2005/06/24/432308.aspx
Here is how to make ASP debugging work:
Enable ASP debugging on the server. (I also added DEBUG verb to the asp extension, but I am not sure if it is required).
Open classic ASP in VS 2005.
Set breakpoint.
View page in browser or run without debugging.
Debug | Attach to Process
Locate IIS ASP worker process (w3wp.exe on IIS6) which exposes x86 and Script and attach as Script.
From eddiegroves comment below:
Regarding Step #1 in IIS7 - IIS > ASP > Compilation > Debugging Properties > Enable Server-side Debugging
I realize this is old, but thought I'd reply to help others since I was looking something else up.
You can use Visual Studio to debug Classic ASP.
If you're running a local copy of IIS, just attach the debugger to the w3wp.exe process and you can set breakpoints, add variables to watch windows, etc.
If you have more than 1 website, it's helpful to run each in a separate application pool, and you'll be able to identify different w3wp.exe process in the Attach Process window.
Just choose "script" as the debugger type. If you're running IISExpress, then the iisexpress.exe process is the correct one to attach to.
I've found that a useful setting to enable is found at the server level under ASP > Compilation > Debugging Properties > Send Errors To Browser. Set that to "True".
This may not be appropriate under all circumstances (e.g. for an internet-accessible site).
Built in classic ASP debugging is pretty poor. I put together this ASP include class which works with Firebug+FirePHP. It allows you to log values (including strings, multi-dimensional arrays and even objects created with json.asp) to the firebug console and view ASP's built in collection objects which can help (particularly with Ajax where you can't output debug data without breaking the json response.) Ajax script load times and errors are automatically logged for quick viewing.
https://github.com/dmeagor/ClassicASP-FirePHP
Released under MIT open source license
This is the way I figured it out:
Put a stop (write stop) on the place where you want to hit the debug point. Then run the application on browser. When the execution comes to stop it will open up debug popup asking do debug with Visual studio (a VS version must be installed). Then it will ask to attach the process and you can use f10, f11 to go step over and in. You can see the data using add watch.
I use the following (which I got from somewhere online) to write to a log file. I would prefer a method for writing directly to Console in Firefox or Chrome, but this works pretty well for me.
NOTE: "timestamp" is a custom function of mine. You can probably guess what it does, and probably roll your own. ;-)
function error_log( message )
dim objFSO, objLog
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objLog = objFSO.OpenTextFile( "ASP_errors.log", 8, true)
objLog.WriteLine "[" & timestamp & "] VBS Message: " & message
objLog.close
set objLog = nothing
set objFSO = nothing
end function
host your site on IIS server.
enable remote debugger on IIS server.(follow this tutorial)
import the source code into visual studio.
install remote debugging tool from here
In the remote debugging tool select tools-> options -> no authentication for all users.
Go to visual studio and attach to process w3wp.exe.
if cant see the process (w3wp.exe). Open the website link in browser and select show for all users
now u will be able to see the process and attach.
Dont forget to put a debugger in the application :-)

C# Windows Service - Set service login Issue

I'm building a windows service that retrieves information about different hardware, and after that it stores the information in a database, right now that part is done and im trying to install that service in different computers, and i wanted to know if the little window that pops up during the installation, called Set Service login, is possible to set some default values in those textboxes.
Thanks in advance.
If you use the Visual Studio Installer you could try this:
View the code of the processInstaller and go into InitializeComponent() methode.
There you can set the following properties for an existing local account:
this.servicename_processInstaller.Password = "xxxxx";
this.servicename_processInstaller.Username = ".\\localServiceUserAccount";
This prevent to prompt the window.

Visual Studio unable to open port to host WCF Service

I created a solution VS2010 C# with the WCF service, the library to get data, the service is working fine in a console application in the solution. No problem.
I have to use it on a VS2008 project (and probably later on a VS2005) for the older projects. Then I start VS2010 I get the "WCF Test Client". At this time in the VS2008, I tried to "Add a web reference" on the local machine... no result.
Then I tried to create a console application with Vs2010 to host it, I did this :
Uri baseAddress = new Uri("http://localhost:8080/hello");
using (ServiceHost host = new ServiceHost(typeof(SecurityAccessWCF.WCFSecurityService), baseAddress))
{
// Enable metadata publishing.
ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
smb.HttpGetEnabled = true;
smb.MetadataExporter.PolicyVersion = PolicyVersion.Policy15;
host.Description.Behaviors.Add(smb);
host.Open();
Console.WriteLine("The service is ready at {0}", baseAddress);
Console.WriteLine("Press <Enter> to stop the service.");
Console.ReadLine();
// Close the ServiceHost.
host.Close();
}
I get an error on the Open(), I get this error "AddressAccessDeniedException - HTTP could not register URL... Your process does not have access rights" (the link provided is not clear, I'm on Win7 x64 as local admin and in a domain)
Shift + Mouse Right Click on Visual Studio shortcut and select Run as administrator
This way you should be able to host it.
Alternately, you could build the project and run the resulting console application the same way under admin account.
Thats a standard error meaning your application cant register the domain. Normally this is a problem on vista/windows 7 with security. Log in as administrator and run netsh http add urlacl url=http://+:80/Localhost user=DOMAIN\user
Here is a msdn article with more information

Install Shield 2009 Premier, Uninstall doesn't close the process/gui

My application (developed using C#.net) is open now i uninstall, InstallShield gives message stating the application is already open and whether really want to close the application. Selection 'Ignore' continues uninstall. Some files and the exe of the application are not closed. How to close them by installshield on uninstall. Or there are some properties I have to set. I know adding a custom action at uninstall i can kill the process, but shouldn't installshield do it?
If your goal is to restart the open applications and not honor the "Ignore" selection, you might consider setting the "REBOOT" property to "Force". That will ask that user to restart the system, thus achieving your desired result.
If your project type is InstallScript MSI or it supports Installscript, i prefer to write code for this for example:
export prototype _Server_UnInstalling();
function _Server_UnInstalling()
STRING Application, ServiceName;
begin
//application name
Application = "Demo";
MessageBox("In _Server_UnInstalling",INFORMATION);
//Check whether application is running or not.
if ProcessRunning( Application ) then
MessageBox("Demo is running",INFORMATION);
//Close server Application
ProcessEnd(Application);
endif;
//if application is having service at the background then
ServiceName = "Demo Server";
//Uninstall the server windows services on uninstallation.
ServiceRemoveDuringUninstallation(ServiceName);
end;
The above example give the skeleton, you need to implement the logic for ProcessRunning, ProcessEnd and ServiceRemoveDuringUninstallation methods, you can refer Installshield help doc they have given documentation with along with source code
hope this helps...

Resources