Since Kernel32 is not a COM library, you cannot use COM interop to call its functions. However, you can use Platform Invoke.
For example, to reference the MoveFile function from Kernel32:
HTH.Code:public class wrapper { [DllImport("Kernel32.dll")] public static extern int MoveFile(string moveFrom, string moveTo); }; // and then... wrapper.MoveFile(@"C:\test.txt", @"C:\test_moved.txt");





Reply With Quote