Export (0) Print
Expand All
0 out of 2 rated this helpful - Rate this topic

ProcessStartInfo.UserName Property

Note: This property is new in the .NET Framework version 2.0.

Gets or sets the user name to be used when starting the process.

Namespace: System.Diagnostics
Assembly: System (in system.dll)

public string UserName { get; set; }
/** @property */
public String get_UserName ()

/** @property */
public void set_UserName (String value)

public function get UserName () : String

public function set UserName (value : String)

Property Value

The user name to use when starting the process.
NoteImportant:

   The WorkingDirectory property must be set if UserName and Password are provided. If the property is not set, the default working directory is %SYSTEMROOT%\system32.

If the UserName property is not a null reference (Nothing in Visual Basic) or an empty string, the UseShellExecute property must be false, or an InvalidOperationException will be thrown when the Process.Start(ProcessStartInfo) method is called.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.