Answer the question
In order to leave comments, you need to log in
How to change the bitness of a .net application?
static void Main(string[] args)
{
StartProcess();
}
static void StartProcess()
{
Process.Start("C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe", "https://www.google.com");
}
Answer the question
In order to leave comments, you need to log in
Digitization is definitely not in business here.
As already noted - Start requires an explicit path to the launcher (otherwise, they may well slip something completely different).
To "bypass" the restriction in the form of a mandatory explicit path, you can use several options:
- run cmd.exe specifying the application to be launched in the parameters - it will only help if the application is located anywhere, but it is registered in the path
- shovel the file system and find a specific path to the application ( Directory.GetFiles) - there may be several applications and you will have to make a choice
- check for availability in the expected places and ask the user if not, and then save it for subsequent launches
p / s / you can still dig into the registry to check for installed programs and get the path from there
On one forum, they suggested that the matter was in the bitness of the application.
When I specify a relative path, an exception is thrown.
Process.Start("https://www.google.com");
Project properties
Target = "Any CPU"
Prefer 32-bit = false
In general, it's good practice to launch the default browser by specifying the URL itself instead of the path to the program and setting the UseShellExecute=true property. If you want to provide a browser choice, then you need to get into HKEY_CLASSES_ROOT and pull out a list of handlers from it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question