Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

lancer un process sous un autre nom

2 réponses
Avatar
Nicopil
Bon, voil=E0 j'ai trouv=E9 une deuxieme m=E9thode pour identifier plus ou
moins les process du serveur... mais qui ne marche pas non plus ;
voici mon code :




string arguments=3Dparametres.Text;
System.Diagnostics.Process proc =3D new System.Diagnostics.Process();
proc.StartInfo.UserName =3D Session["usernameValue"].ToString();

string passwordEnClair=3DSession["passwordValue"].ToString();

System.Security.SecureString ChaineSecurisee=3Dnew
System.Security.SecureString();
for(int i=3D0;i<passwordEnClair.Length;i++)
{
ChaineSecurisee.AppendChar(passwordEnClair[i]);
}
proc.StartInfo.Password=3DChaineSecurisee;

proc.StartInfo.RedirectStandardOutput =3D true;
proc.StartInfo.UseShellExecute =3D false;
proc.Start();


Pour r=E9sumer : je mets les username et mot de passe dans une variable
de session, et je veux les r=E9utiliser pour lancer mon process; Je
pense qu'en th=E9orie tout est OK, mais en pratique, il me renvoit
l'erreur suivante :


Source Error:
Line 17: string arguments=3Dparametres.Text;
Line 18: System.Diagnostics.Process proc =3D new
System.Diagnostics.Process();
Line 19: proc.StartInfo.UserName =3D
Session["usernameValue"].ToString(); <<<<---- ERREUR
Line 21:




C:\WINDOWS\system32> "c:\windows\microsoft.net\framework
\v1.1.4322\csc.exe" /t:library /utf8output /R:"c:\windows\assembly\gac
\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll" /R:"c:\windows
\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll" /R:"c:
\windows\assembly\gac\system.web.services\1.0.5000.0__b03f5f7f11d50a3a
\system.web.services.dll" /R:"c:\windows\assembly\gac\system.xml
\1.0.5000.0__b77a5c561934e089\system.xml.dll" /R:"c:\windows\assembly
\gac\system.web.mobile\1.0.5000.0__b03f5f7f11d50a3a
\system.web.mobile.dll" /R:"c:\windows\assembly\gac\system.drawing
\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll" /R:"c:\windows
\assembly\gac\system.data
\1.0.5000.0__b77a5c561934e089\system.data.dll" /R:"c:\windows\assembly
\gac\system.enterpriseservices\1.0.5000.0__b03f5f7f11d50a3a
\system.enterpriseservices.dll" /R:"c:\windows\microsoft.net\framework
\v1.1.4322\mscorlib.dll" /out:"C:\WINDOWS\Microsoft.NET\Framework
\v1.1.4322\Temporary ASP.NET Files\root\36a58ec3\eb3671ac
\b_s2cmy3.dll" /debug- /optimize+ /warnaserror /w:1 "C:\WINDOWS
\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root
\36a58ec3\eb3671ac\b_s2cmy3.0.cs"


Microsoft (R) Visual C# .NET Compiler version 7.10.6001.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.

C:\Users\powershell\webfindprinterqueue.aspx(19,3): error CS0117:
'System.Diagnostics.ProcessStartInfo' does not contain a definition
for 'UserName'
C:\Users\powershell\webfindprinterqueue.aspx(24,19): error CS0234: The
type or namespace name 'SecureString' does not exist in the class or
namespace 'System.Security' (are you missing an assembly reference?)
C:\Users\powershell\webfindprinterqueue.aspx(27,4): error CS0246: The
type or namespace name 'ChaineSecurisee' could not be found (are you
missing a using directive or an assembly reference?)
C:\Users\powershell\webfindprinterqueue.aspx(29,3): error CS0117:
'System.Diagnostics.ProcessStartInfo' does not contain a definition
for 'Password'




svp aidez moi !!!
bye
Nico

2 réponses

Avatar
Patrice
Bonjour,

Cette propriété n'existe pas en version 1.1 (ce qui est indiqué dans la
documentation) :
http://msdn2.microsoft.com/fr-fr/library/system.diagnostics.processstartinfo.username(VS.80).aspx

--
Patrice

"" a écrit dans le message de news:

Bon, voilà j'ai trouvé une deuxieme méthode pour identifier plus ou
moins les process du serveur... mais qui ne marche pas non plus ;
voici mon code :




string arguments=parametres.Text;
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.UserName = Session["usernameValue"].ToString();

string passwordEnClair=Session["passwordValue"].ToString();

System.Security.SecureString ChaineSecurisee=new
System.Security.SecureString();
for(int i=0;i<passwordEnClair.Length;i++)
{
ChaineSecurisee.AppendChar(passwordEnClair[i]);
}
proc.StartInfo.Password=ChaineSecurisee;

proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.UseShellExecute = false;
proc.Start();


Pour résumer : je mets les username et mot de passe dans une variable
de session, et je veux les réutiliser pour lancer mon process; Je
pense qu'en théorie tout est OK, mais en pratique, il me renvoit
l'erreur suivante :


Source Error:
Line 17: string arguments=parametres.Text;
Line 18: System.Diagnostics.Process proc = new
System.Diagnostics.Process();
Line 19: proc.StartInfo.UserName Session["usernameValue"].ToString(); <<<<---- ERREUR
Line 21:




C:WINDOWSsystem32> "c:windowsmicrosoft.netframework
v1.1.4322csc.exe" /t:library /utf8output /R:"c:windowsassemblygac
system.web1.0.5000.0__b03f5f7f11d50a3asystem.web.dll" /R:"c:windows
assemblygacsystem1.0.5000.0__b77a5c561934e089system.dll" /R:"c:
windowsassemblygacsystem.web.services1.0.5000.0__b03f5f7f11d50a3a
system.web.services.dll" /R:"c:windowsassemblygacsystem.xml
1.0.5000.0__b77a5c561934e089system.xml.dll" /R:"c:windowsassembly
gacsystem.web.mobile1.0.5000.0__b03f5f7f11d50a3a
system.web.mobile.dll" /R:"c:windowsassemblygacsystem.drawing
1.0.5000.0__b03f5f7f11d50a3asystem.drawing.dll" /R:"c:windows
assemblygacsystem.data
1.0.5000.0__b77a5c561934e089system.data.dll" /R:"c:windowsassembly
gacsystem.enterpriseservices1.0.5000.0__b03f5f7f11d50a3a
system.enterpriseservices.dll" /R:"c:windowsmicrosoft.netframework
v1.1.4322mscorlib.dll" /out:"C:WINDOWSMicrosoft.NETFramework
v1.1.4322Temporary ASP.NET Filesroot36a58ec3eb3671ac
b_s2cmy3.dll" /debug- /optimize+ /warnaserror /w:1 "C:WINDOWS
Microsoft.NETFrameworkv1.1.4322Temporary ASP.NET Filesroot
36a58ec3eb3671acb_s2cmy3.0.cs"


Microsoft (R) Visual C# .NET Compiler version 7.10.6001.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.

C:Userspowershellwebfindprinterqueue.aspx(19,3): error CS0117:
'System.Diagnostics.ProcessStartInfo' does not contain a definition
for 'UserName'
C:Userspowershellwebfindprinterqueue.aspx(24,19): error CS0234: The
type or namespace name 'SecureString' does not exist in the class or
namespace 'System.Security' (are you missing an assembly reference?)
C:Userspowershellwebfindprinterqueue.aspx(27,4): error CS0246: The
type or namespace name 'ChaineSecurisee' could not be found (are you
missing a using directive or an assembly reference?)
C:Userspowershellwebfindprinterqueue.aspx(29,3): error CS0117:
'System.Diagnostics.ProcessStartInfo' does not contain a definition
for 'Password'




svp aidez moi !!!
bye
Nico
Avatar
Nicopil
On 22 oct, 15:45, "Patrice" <http://www.chez.com/scribe/> wrote:
Bonjour,

Cette propriété n'existe pas en version 1.1 (ce qui est indiqué dan s la
documentation) :http://msdn2.microsoft.com/fr-fr/library/system.diagnosti cs.processst...

--
Patrice

"" a écrit dans le message de news:

Bon, voilà j'ai trouvé une deuxieme méthode pour identifier plus ou
moins les process du serveur... mais qui ne marche pas non plus ;
voici mon code :

string arguments=parametres.Text;
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.UserName = Session["usernameValue"].ToString();

string passwordEnClair=Session["passwordValue"].ToString();

System.Security.SecureString ChaineSecurisee=new
System.Security.SecureString();
for(int i=0;i<passwordEnClair.Length;i++)
{
ChaineSecurisee.AppendChar(passwordEnClair[i]);}

proc.StartInfo.Password=ChaineSecurisee;

proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.UseShellExecute = false;
proc.Start();

Pour résumer : je mets les username et mot de passe dans une variable
de session, et je veux les réutiliser pour lancer mon process; Je
pense qu'en théorie tout est OK, mais en pratique, il me renvoit
l'erreur suivante :

Source Error:
Line 17: string arguments=parametres.Text;
Line 18: System.Diagnostics.Process proc = new
System.Diagnostics.Process();
Line 19: proc.StartInfo.UserName =
Session["usernameValue"].ToString(); <<<<---- ERREUR
Line 21:

C:WINDOWSsystem32> "c:windowsmicrosoft.netframework
v1.1.4322csc.exe" /t:library /utf8output /R:"c:windowsassemblygac
system.web1.0.5000.0__b03f5f7f11d50a3asystem.web.dll" /R:"c:windows
assemblygacsystem1.0.5000.0__b77a5c561934e089system.dll" /R:"c:
windowsassemblygacsystem.web.services1.0.5000.0__b03f5f7f11d50a3a
system.web.services.dll" /R:"c:windowsassemblygacsystem.xml
1.0.5000.0__b77a5c561934e089system.xml.dll" /R:"c:windowsassembly
gacsystem.web.mobile1.0.5000.0__b03f5f7f11d50a3a
system.web.mobile.dll" /R:"c:windowsassemblygacsystem.drawing
1.0.5000.0__b03f5f7f11d50a3asystem.drawing.dll" /R:"c:windows
assemblygacsystem.data
1.0.5000.0__b77a5c561934e089system.data.dll" /R:"c:windowsassembly
gacsystem.enterpriseservices1.0.5000.0__b03f5f7f11d50a3a
system.enterpriseservices.dll" /R:"c:windowsmicrosoft.netframework
v1.1.4322mscorlib.dll" /out:"C:WINDOWSMicrosoft.NETFramework
v1.1.4322Temporary ASP.NET Filesroot36a58ec3eb3671ac
b_s2cmy3.dll" /debug- /optimize+ /warnaserror /w:1 "C:WINDOWS
Microsoft.NETFrameworkv1.1.4322Temporary ASP.NET Filesroot
36a58ec3eb3671acb_s2cmy3.0.cs"

Microsoft (R) Visual C# .NET Compiler version 7.10.6001.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.

C:Userspowershellwebfindprinterqueue.aspx(19,3): error CS0117:
'System.Diagnostics.ProcessStartInfo' does not contain a definition
for 'UserName'
C:Userspowershellwebfindprinterqueue.aspx(24,19): error CS0234: The
type or namespace name 'SecureString' does not exist in the class or
namespace 'System.Security' (are you missing an assembly reference?)
C:Userspowershellwebfindprinterqueue.aspx(27,4): error CS0246: The
type or namespace name 'ChaineSecurisee' could not be found (are you
missing a using directive or an assembly reference?)
C:Userspowershellwebfindprinterqueue.aspx(29,3): error CS0117:
'System.Diagnostics.ProcessStartInfo' does not contain a definition
for 'Password'

svp aidez moi !!!
bye
Nico



argh... ok, merci pour l'information

Nico