[DllImport("rasapi32.dll")]
public static extern int RasGetEntryDialParams(string pbook,IntPtr ipBuff,bool b);
/// <summary>
/// 枚举窗口
/// </summary>
[DllImport("user32.Dll")]
public static extern int EnumWindows(CallBack x, int y);  /// <summary>
/// 取窗口标题
/// </summary>
[DllImport("User32.Dll")]
public static extern void GetWindowText(IntPtr h, StringBuilder s, int nMaxCount);

解决方案 »

  1.   

    http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=6956
      

  2.   

    C#怎样打开关闭CDROM?
    using System;
    using System.Text;
    using System.Runtime.InteropServices;class CloseCD
    {  [DllImport("winmm.dll", EntryPoint="mciSendStringA", CharSet=CharSet.Ansi )]
      protected static extern int mciSendString( string lpstrCommand, StringBuilder lpstrReturnString, int uReturnLength, IntPtr hwndCallback );  public static void Main()
      {    int ret = mciSendString( "set cdaudio door open", null, 0, IntPtr.Zero );    Console.ReadLine();

        ret = mciSendString( "set cdaudio door closed", null, 0, IntPtr.Zero );
      }
    }
      

  3.   

    看看:
    <Root>\SDK\v1.1\Samples\Technologies\Interop\PlatformInvoke