Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than userenv, prefix the name with the module name and a period.
DeleteProfile (userenv)
.
C# Signature:
[DllImport("userenv", SetLastError=true)]
private static extern int DeleteProfile(string lpSidString, string lpProfilePath, string lpComputerName);
Notes:
None
Tips & Tricks:
None
Sample Code:
// Get the user SID using the Win32Security library. Get this lib at www.gotdotnet.com
Sid oSid = new Sid(@"csharp\test");
int retValue = DeleteProfile(oSid.SidString, null, "SERVER01");
// According to API documentation at MSDN 0 is returned when an error has occurred, so let's throw a Win32Exception when this happens.
if (retValue == 0)
throw new Win32Exception(Marshal.GetLastWin32Error());
The DeleteProfile function deletes the user profile and all user-related settings from the specified computer. The caller must have administrative privileges to delete a user's profile.
3/16/2007 8:32:59 AM - -201.25.215.28
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).