I tried this:
ProcessStartInfo psi = new ProcessStartInfo("http://qaru.site/"); psi.RedirectStandardOutput = false; psi.WindowStyle = ProcessWindowStyle.Hidden; psi.UseShellExecute = false; Process.Start(psi);
But I get an exception in the line Process.Start (psi);
Win32Exception System cannot find the specified file
If I change the line psi.UseShellExecute = true; Then it works, but does not close the window.
I want that when opening a browser, for example, /qaru.site / ... , the user will not see the window at any time, but the window will still be open. This is not to close, but to hide it.
I tried Google, but could not find a working solution.
Win32Exception message:
System.ComponentModel.Win32Exception was unhandled HResult=-2147467259 Message=The system cannot find the file specified Source=System ErrorCode=-2147467259 NativeErrorCode=2 StackTrace: at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) at CuteDadyImages.Form1.OpenBroswerTab() in d:\C-Sharp\test\Form1.cs:line 155 at CuteDadyImages.Form1..ctor() in d:\C-Sharp\test\Form1.cs:line 55 at CuteDadyImages.Program.Main() in d:\C-Sharp\test\Program.cs:line 35 at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException:
source share