External Method : DllImport : Windows C# Examples


C# Examples » Windows » DllImport »

 

External Method









    
using  System;
using  System.Text;
using  System.Runtime.InteropServices;

class  MainClass
{
      [DllImport("kernel32",  SetLastError  =  true)]
      public  static  extern  int  GetCurrentDirectory(int  a,  StringBuilder  b);

      static  void  Main()
      {
            StringBuilder  sb  =  new  StringBuilder();
            sb.Length  =  250;
            GetCurrentDirectory(250,  sb);
            Console.WriteLine(sb);
      }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Windows
» DllImport