G Guest May 6, 2005 #1 Hello How to convert value of WindowsIdentity.Token that is IntPtr type to string type? Thanks
L Lebesgue May 6, 2005 #2 public static string PtrToStringAuto(IntPtr ptr) string myString = System.Runtime.InteropServices.Marshal.PtrToStringAuto(myIntPtr); http://msdn.microsoft.com/library/d...pservicesmarshalclassptrtostringautotopic.asp http://msdn.microsoft.com/library/d...emruntimeinteropservicesmarshalclasstopic.asp
public static string PtrToStringAuto(IntPtr ptr) string myString = System.Runtime.InteropServices.Marshal.PtrToStringAuto(myIntPtr); http://msdn.microsoft.com/library/d...pservicesmarshalclassptrtostringautotopic.asp http://msdn.microsoft.com/library/d...emruntimeinteropservicesmarshalclasstopic.asp
G Guest May 6, 2005 #3 I tried out. But I recieved "null" as returned value to string. string myString = System.Runtime.InteropServices.Marshal.PtrToStringAuto(myIntPtr); After this line, myString is null. WindowsIdentity.Token is correct value, but returned string is null. Thanks
I tried out. But I recieved "null" as returned value to string. string myString = System.Runtime.InteropServices.Marshal.PtrToStringAuto(myIntPtr); After this line, myString is null. WindowsIdentity.Token is correct value, but returned string is null. Thanks
W Willy Denoyette [MVP] May 6, 2005 #4 MilanB said: Hello How to convert value of WindowsIdentity.Token that is IntPtr type to string type? Thanks Click to expand... Why would you do this? The IntPtr is NOT pointing to a string, actualy it points to nothing it is a HANDLE. Willy.
MilanB said: Hello How to convert value of WindowsIdentity.Token that is IntPtr type to string type? Thanks Click to expand... Why would you do this? The IntPtr is NOT pointing to a string, actualy it points to nothing it is a HANDLE. Willy.
G Guest May 6, 2005 #5 Thanks Willy Someone wanted from me to convert this pointer to string. I suposed that it can not be done, but was not sure 100%. Thanks again
Thanks Willy Someone wanted from me to convert this pointer to string. I suposed that it can not be done, but was not sure 100%. Thanks again