WINCE下,如何在C#里打开一个IE,进入一个URL?

使用C#调用CreateProcess
本文介绍了一段C#代码示例,该代码通过调用CreateProcess函数启动Internet Explorer并打开指定网址。CreateProcess函数来自coredll.dll库,用于创建新的进程。示例中还定义了一个processinfo类,用于接收新进程的信息。
[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);    
  }  
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值