日期:2014-05-17 浏览次数:20790 次
[DllImport("youdll.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int ConnectServer([MarshalAs(UnmanagedType.LPStr)] StringBuilder cUser, [MarshalAs(UnmanagedType.LPStr)] StringBuilder cPass, [MarshalAs(UnmanagedType.LPStr)] StringBuilder clp, [MarshalAs(UnmanagedType.LPStr)] StringBuilder cNEName);
public void CallTest()
{
StringBuilder cUser = new StringBuilder("username".PadRight(64, (Char)0));
StringBuilder cPass = new StringBuilder("Password".PadRight(64, (char)0));
StringBuilder clp = new StringBuilder("clpvalue".PadRight(64, (char)0));
StringBuilder cNEName = new StringBuilder("cnenameValue".PadRight(64, (char)0));
int ret = ConnectServer(cUser, cPass, clp, cNEName);
}