B
Brian Stoop
Hi,
[DllImport("Netapi32.dll")]
extern public static int NetUserSetInfo(
[MarshalAs(UnmanagedType.LPWStr)] string servername,
[MarshalAs(UnmanagedType.LPWStr)] string username,
int level,
ref USER_INFO_1003 buf,
int error);
public struct USER_INFO_1003
{
public string usri1003_password;
}
I currently use strings to pass passwords into USER_INFO_1003 passwords, and
call NetSetInfo to set the password for an account somewhere, e.g:
string newpassword="SomePassword";
USER_INFO_1003 UserInfo1003 = new USER_INFO_1003();
UserInfo1003.usri1003_password = newpassword;
Now I store passwords in SecureStrings. How set passwords in NetUserSetInfo
calls without converting them to a string?
thanks, B
[DllImport("Netapi32.dll")]
extern public static int NetUserSetInfo(
[MarshalAs(UnmanagedType.LPWStr)] string servername,
[MarshalAs(UnmanagedType.LPWStr)] string username,
int level,
ref USER_INFO_1003 buf,
int error);
public struct USER_INFO_1003
{
public string usri1003_password;
}
I currently use strings to pass passwords into USER_INFO_1003 passwords, and
call NetSetInfo to set the password for an account somewhere, e.g:
string newpassword="SomePassword";
USER_INFO_1003 UserInfo1003 = new USER_INFO_1003();
UserInfo1003.usri1003_password = newpassword;
Now I store passwords in SecureStrings. How set passwords in NetUserSetInfo
calls without converting them to a string?
thanks, B