以打开一个IE为例,介绍如何在WinCE下使用C#来打开一个外部文件:

 

using System.Runtime.InteropServices;
 
[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 button_Click(object sender, System.EventArgs e) 
{ 
    ProcessInfo  pi  =  new  ProcessInfo(); 
    CreateProcess("\\windows\\iesample.exe", 
                     "\\HardDisk\\Readme.htm", IntPtr.Zero, 
                   IntPtr.Zero, 0, 0, IntPtr.Zero,  IntPtr.Zero,  IntPtr.Zero,  pi);   
} 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-03
  • 2022-02-25
  • 2021-09-29
  • 2022-12-23
  • 2022-12-23
  • 2022-02-20
相关资源
相似解决方案