process.start

Process.Start() with arguments to start Google Chrome

三世轮回 提交于 2019-12-08 10:52:28
I am trying to launch Google Chrome browser from a .NET program, with arguments. But I get strange behavior. The following launches Chrome in ' incognito ' mode from a command line. It works fine. "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --incognito But the following does not work in .NET. Chrome does open, but not incognito and it goes to this weird URL: http://xn---incognito-nu6e/ Module Module1 Sub Main() System.Diagnostics.Process.Start("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", "–-incognito") End Sub End Module You can use shortcut when call the

Process.Start() with arguments to start Google Chrome

我的梦境 提交于 2019-12-08 06:51:36
问题 I am trying to launch Google Chrome browser from a .NET program, with arguments. But I get strange behavior. The following launches Chrome in ' incognito ' mode from a command line. It works fine. "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --incognito But the following does not work in .NET. Chrome does open, but not incognito and it goes to this weird URL: http://xn---incognito-nu6e/ Module Module1 Sub Main() System.Diagnostics.Process.Start("C:\Program Files (x86)\Google

mono Process.Start how to find bash?

霸气de小男生 提交于 2019-12-08 02:21:10
问题 In my webapp i do the below. I know its correct because i tried 1) dumping start_sz to a text file 2) su www-data 3) copy/paste the extract string and it worked. var start_sz = string.Format(@"bash -c 'ln ""{2}/{0}"" ""{2}/{1}""'", fn, newfn, System.IO.Directory.GetCurrentDirectory()); Process.Start(start_sz); I get the exception below so with reasoning above i believe its saying bash cannot be found. Cannot find the specified file at System.Diagnostics.Process.Start_shell (System.Diagnostics

Process.Start is blocking/hanging randomly on some clients

点点圈 提交于 2019-12-07 01:25:51
问题 (There is a very similar topic that never got solved: here) We have a big app running on several clients, but recently some of my code stopped working. Adding some debug code I found out the code stops at a call to Process.Start() (with no shellexecute=true set). The call is a simple Process.Start(new ProcessStartInfo("program")) in a BackgroundWorker thread. The "program" app does what it should do and exits. Our application continues as the thread is in the background but if the application

mono Process.Start how to find bash?

ぃ、小莉子 提交于 2019-12-06 14:31:26
In my webapp i do the below. I know its correct because i tried 1) dumping start_sz to a text file 2) su www-data 3) copy/paste the extract string and it worked. var start_sz = string.Format(@"bash -c 'ln ""{2}/{0}"" ""{2}/{1}""'", fn, newfn, System.IO.Directory.GetCurrentDirectory()); Process.Start(start_sz); I get the exception below so with reasoning above i believe its saying bash cannot be found. Cannot find the specified file at System.Diagnostics.Process.Start_shell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in :0 at System.Diagnostics

How do you open a local html file in a web browser when the path contains an url fragment

牧云@^-^@ 提交于 2019-12-06 10:49:41
I am trying to open a web browser via the following methods. However, when the browser opens the url / file path, the fragment piece gets mangled (from "#anchorName" to "%23anchorName") which does not seem to get processed. So basically, the file opens but does not jump to the appropriate location in the document. Does anyone know how to open the file and have the fragment processed? Any help on this would be greatly appreciated. an example path to open would be "c:\MyFile.Html#middle" // calls out to the registry to get the default browser private static string GetDefaultBrowserPath() {

How to bring up the “Windows cannot open this file” dialog?

寵の児 提交于 2019-12-06 02:42:14
问题 My users can attach documents to various entities in the application. Of course, if user A attaches a .TIFF file, user B may not have a viewer for that type of file. So I'd like to be able to bring up this dialog: alt text http://www.angryhacker.com/toys/cannotopen.png My application is C# with VS2005. Currently I do Process.Start and pass in the file name. If no association is found, it throws an exception. 回答1: This should do it: System.Diagnostics.Process p = new System.Diagnostics.Process

Process.Start is blocking/hanging randomly on some clients

非 Y 不嫁゛ 提交于 2019-12-05 05:27:31
(There is a very similar topic that never got solved: here ) We have a big app running on several clients, but recently some of my code stopped working. Adding some debug code I found out the code stops at a call to Process.Start() (with no shellexecute=true set). The call is a simple Process.Start(new ProcessStartInfo("program")) in a BackgroundWorker thread. The "program" app does what it should do and exits. Our application continues as the thread is in the background but if the application runs another Process.Start on the GUI thread, the app locks up. If the application is closed with the

Process.Start(/* path to pdf */) doesn't work with Adobe Reader on Windows 8

橙三吉。 提交于 2019-12-05 00:50:23
I'm able to create PDFs in my C#/WPF application and run them with the following: Process.Start(_pathToPDFFile); This works with Adobe Acrobat, but not with Adobe Reader. When Adobe Reader is installed, Process.Start() does nothing unless the Reader process is already running in the Task Manager. How can I get Adobe Reader to show the PDF when I attempt to start a PDF? In our case, the problem was only reproducible when starting the application from Visual Studio - starting the .exe directly works as expected. After some debugging, it turned out that Visual Studio was set to always run as

How to bring up the “Windows cannot open this file” dialog?

江枫思渺然 提交于 2019-12-04 08:14:12
My users can attach documents to various entities in the application. Of course, if user A attaches a .TIFF file, user B may not have a viewer for that type of file. So I'd like to be able to bring up this dialog: alt text http://www.angryhacker.com/toys/cannotopen.png My application is C# with VS2005. Currently I do Process.Start and pass in the file name. If no association is found, it throws an exception. This should do it: System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo.FileName = "rundll32.exe"; p.StartInfo.Arguments = "shell32.dll,OpenAs_RunDLL " +