[dllimport("coredll.dll", entrypoint="createprocess", setlasterror=true)]
extern static int createprocess(string strimagename, string strcmdline, intptr pprocessattributes, intptr pthreadattributes , int binheritshandle, int dwcreationflags, intptr penvironment, intptr pcurrentdir, intptr barray, processinfo oproc);
public class processinfo
{
public int32 hprocess;
public int32 hthread;
public int32 processid;
public int32 threadid;
}
private void buttonopen_click(object sender, system.eventargs e)
{
processinfo pi = new processinfo();
createprocess("iexplore.exe" , "http://www.youkuaiyun.com", intptr.zero, intptr.zero, 0, 0, intptr.zero, intptr.zero, intptr.zero, pi);
} [dllimport("coredll.dll", entrypoint="createprocess", setlasterror=true)]
extern static int createprocess(string strimagename, string strcmdline, intptr pprocessattributes, intptr pthreadattributes , int binheritshandle, int dwcreationflags, intptr penvironment, intptr pcurrentdir, intptr barray, processinfo oproc);
public class processinfo
{
public int32 hprocess;
public int32 hthread;
public int32 processid;
public int32 threadid;
}
private void buttonopen_click(object sender, system.eventargs e)
{
processinfo pi = new processinfo();
createprocess("iexplore.exe" , "http://www.youkuaiyun.com", intptr.zero, intptr.zero, 0, 0, intptr.zero, intptr.zero, intptr.zero, pi);
}
extern static int createprocess(string strimagename, string strcmdline, intptr pprocessattributes, intptr pthreadattributes , int binheritshandle, int dwcreationflags, intptr penvironment, intptr pcurrentdir, intptr barray, processinfo oproc);
public class processinfo
{
public int32 hprocess;
public int32 hthread;
public int32 processid;
public int32 threadid;
}
private void buttonopen_click(object sender, system.eventargs e)
{
processinfo pi = new processinfo();
createprocess("iexplore.exe" , "http://www.youkuaiyun.com", intptr.zero, intptr.zero, 0, 0, intptr.zero, intptr.zero, intptr.zero, pi);
} [dllimport("coredll.dll", entrypoint="createprocess", setlasterror=true)]
extern static int createprocess(string strimagename, string strcmdline, intptr pprocessattributes, intptr pthreadattributes , int binheritshandle, int dwcreationflags, intptr penvironment, intptr pcurrentdir, intptr barray, processinfo oproc);
public class processinfo
{
public int32 hprocess;
public int32 hthread;
public int32 processid;
public int32 threadid;
}
private void buttonopen_click(object sender, system.eventargs e)
{
processinfo pi = new processinfo();
createprocess("iexplore.exe" , "http://www.youkuaiyun.com", intptr.zero, intptr.zero, 0, 0, intptr.zero, intptr.zero, intptr.zero, pi);
}
使用C#调用CreateProcess
本文介绍了一段C#代码示例,该代码通过调用CreateProcess函数启动Internet Explorer并打开指定网址。CreateProcess函数来自coredll.dll库,用于创建新的进程。示例中还定义了一个processinfo类,用于接收新进程的信息。

被折叠的 条评论
为什么被折叠?



