C#中int和IntPtr相互转换
方法一、
int转IntPtr
int i = 12;
IntPtr p = new IntPtr(i);
IntPtr转int
int myi = (int)p;
MessageBox.Show(myi.ToString());
方法二、
int转IntPtr
int i = 12;
IntPtr p =(IntPtr)i
IntPtr转int
int myi = (int)p;
MessageBox.Show(myi.ToString());