C#中如何调用Windows API函数?
给几个例子看看吧(尽量别举太简单的)
谢谢了

解决方案 »

  1.   

    http://dev.csdn.net/article/67/article/58/58068.shtm
      

  2.   

    #using <mscorlib.dll>
    using namespace System;
    using namespace System::Runtime::InteropServices;[DllImport("msvcrt", CharSet=CharSet::Ansi)]
    extern "C" int puts(String *);int main()
    {
       String * pStr = S"Hello World!";
       puts(pStr);
    }
      

  3.   

    X:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Samples\Technologies\Interop\PlatformInvoke
      

  4.   

    [DllImport "(dllname)"]
    static extern (methodname)....
      

  5.   

    http://dev.csdn.net/article/67/article/58/58068.shtm
      

  6.   

    在 C# 中通过 P/Invoke 调用Win32 DLL
    http://www.microsoft.com/china/msdn/library/langtool/vcsharp/ousNET.mspx
      

  7.   

    c:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Samples\Technologies\Interop\PlatformInvoke