本文介绍了在CreateProcess的Process.arguments?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面的作品刚刚在的Process.Start形势很好。

 私人字符串路径()
{
的RegistryKey键= Registry.LocalMachine.OpenSubKey(SOFTWARE\\Wizet\\);
的RegistryKey位置= Key.OpenSubKey(冒险岛);
返回Location.GetValue(ExecPath)的ToString()。
}

公共BOOL启动()
{
=枫之谷新的ProcessStartInfo();
maplestory.FileName =路径()+ @\MapleStory.exe
maplestory.Arguments =Webstart的;

=枫之谷的Process.Start(冒险岛);
}



我会在哪里,现在放在.Arguments如果我使用的CreateProcess并会在哪里我把CREATE_SUSPENDED呢?

 的CreateProcess(AppName的,IntPtr.Zero,IntPtr.Zero,IntPtr.Zero,假,0,IntPtr.Zero,空,参考SI,淘汰PI); 


解决方案

在第二个参数,你可以把命令行选项。而在第六​​,你可以把创建选项,如CREATE_SUSPENDED。



的CreateProcess(AppName的Webstart的,IntPtr.Zero,IntPtr.Zero,假,CREATE_SUSPENDED,IntPtr.Zero,空,参考SI,淘汰PI);



有关更多信息,请参阅


The following works just fine in process.start situation.

private string Path()
        {
            RegistryKey Key = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Wizet\\");
            RegistryKey Location = Key.OpenSubKey("MapleStory");
            return Location.GetValue("ExecPath").ToString();
        }

public bool Launch()
        {
            maplestory = new ProcessStartInfo();
            maplestory.FileName = Path() + @"\MapleStory.exe";
            maplestory.Arguments = "WebStart";

            MapleStory = Process.Start(maplestory);
}

Where would I now place the '.Arguments' if I were to use CreateProcess and where would I place CREATE_SUSPENDED as well?

CreateProcess(AppName, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, false, 0, IntPtr.Zero, null, ref si, out pi);
解决方案

In the second argument you can put command line options. And in the sixth you can put creation options like CREATE_SUSPENDED.

CreateProcess(AppName, "WebStart", IntPtr.Zero, IntPtr.Zero, false, CREATE_SUSPENDED, IntPtr.Zero, null, ref si, out pi);

For more information see http://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx

这篇关于在CreateProcess的Process.arguments?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 08:36