Professional Documents
Culture Documents
ADNET Final Day
ADNET Final Day
dll")] publicstaticexternlong PlaySound(string filename,long h,long d); staticvoid Main(String[]args) { long r; string fname = "C:\\Users\\ictlab\\Desktop\\Linux\test.wav"; r = PlaySound(fname, 0, 1); } }
--------------------------------------------------using System; using System.Runtime.InteropServices; classAPItest { [DllImport("user32dll")] staticexternint MessageBox(IntPtr i, string text, string cap, int type); publicstaticvoid Main() { MessageBox(IntPtr.Zero, "Please do not close the door", "Atention", 0); } } ------using System; using System.Text; using System.Runtime.InteropServices; classAPItest { [DllImport("user32dll")] staticexternint GetWindowsDirectory(StringBuilder sb, int maxchars); staticvoid Main() { StringBuilder s = newStringBuilder(256);