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

Traduire une fonction C# en VB.NET

6 réponses
Avatar
Matteo
Bonjour je dois traduire les deux fonction suivante en vb.net

C#

public override void Install(IDictionary stateSaver)
{
// Récupération du chemin d'accès du fichier .ini:
string cheminExe =
System.Reflection.Assembly.GetExecutingAssembly().Location;
string cheminRep = System.IO.Path.GetDirectoryName(cheminExe);
string argIni = cheminRep + "\\InstallSupplementairePPC.ini";

// Récupération du chemin d'accès du fichier CEAppMgr.exe :
string cheminBaseDeRegistre =
"Software\\Microsoft\\Windows\\CurrentVersion" +
"\\App Paths\\CeAppMgr.exe";
Microsoft.Win32.RegistryKey cleRegistre =
Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre);
string cheminCeAppMgr = (string)cleRegistre.GetValue("");

// Lancer l'application avec son argument :
System.Diagnostics.Process.Start(cheminCeAppMgr, "\"" +argIni+ "\"");
}

Vb.NET

Et moi je l'ai traduit comme ca mais quel est le type de l'argument passé en
parametre dans la fonction. Quelq'un à une idée ? Et si vous voyez des
erreurs ailleur dite le moi.
Public Overloads Function install(ByVal IDictionary)

'Récupération du chemin d'accès du fichier .ini:

Dim cheminExe As String =
System.Reflection.Assembly.GetExecutingAssembly().Location

Dim cheminRep As String = System.IO.Path.GetDirectoryName(cheminExe)

Dim argIni As String = cheminRep + "\\InstallSupplementairePPC.ini"

' Récupération du chemin d'accès du fichier CEAppMgr.exe :

Dim cheminBaseDeRegistre As String =
"Software\\Microsoft\\Windows\\CurrentVersion" + "\\App Paths\\CeAppMgr.exe"

'Microsoft.Win32.RegistryKey()

Dim cleRegistre As Microsoft.Win32.RegistryKey =
Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre)

Dim cheminCeAppMgr As String = CType(cleRegistre.GetValue(""), String)

'Lancer l'application avec son argument :

System.Diagnostics.Process.Start(cheminCeAppMgr, "\"" +argIni+ " \ "")

End Function





Et ma deuxieme fonction

C#

public override void Uninstall(IDictionary savedState)
{
// Récupération du chemin d'accès du fichier CEAppMgr.exe :
string cheminBaseDeRegistre =
"Software\\Microsoft\\Windows\\CurrentVersion" +
"\\App Paths\\CEAppMgr.exe";
Microsoft.Win32.RegistryKey cleRegistre =
Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre);
string cheminCEAppMgr = (string)cleRegistre.GetValue("");
// Lancer l'application sans argument (desinstallation) :
System.Diagnostics.Process.Start(cheminCEAppMgr);
}

VB.NET

Et j'ai le meme pb. Que dois je mettre comme type pour l'arguement passer en
parametre ?

Public Overloads Function Uninstall(ByVal IDictionary)

'Récupération du chemin d'accès du fichier CEAppMgr.exe :

Dim cheminBaseDeRegistre As String =
"Software\\Microsoft\\Windows\\CurrentVersion" + "\\App Paths\\CEAppMgr.exe"

Dim cleRegistre As Microsoft.Win32.RegistryKey =
Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre)

Dim cheminCEAppMgr As String = CType(cleRegistre.GetValue(""), String)

'Lancer l'application sans argument (desinstallation) :

System.Diagnostics.Process.Start(cheminCEAppMgr)

End Function


begin 666 None.gif
M1TE&.#EA"P`0`)$``````/_______P```"'Y! $```(`+ `````+`! `0 (,
.E(^IR^T/HYRTVE0``#L`
`
end

6 réponses

Avatar
VANNESTE Xavier
tu nomme pas ton parametre?
byval toto as IDictionary
"Matteo" a écrit dans le message de news:
d2b3i8$b1u$
Bonjour je dois traduire les deux fonction suivante en vb.net

C#

public override void Install(IDictionary stateSaver)
{
// Récupération du chemin d'accès du fichier .ini:
string cheminExe > System.Reflection.Assembly.GetExecutingAssembly().Location;
string cheminRep = System.IO.Path.GetDirectoryName(cheminExe);
string argIni = cheminRep + "InstallSupplementairePPC.ini";

// Récupération du chemin d'accès du fichier CEAppMgr.exe :
string cheminBaseDeRegistre > "SoftwareMicrosoftWindowsCurrentVersion" +
"App PathsCeAppMgr.exe";
Microsoft.Win32.RegistryKey cleRegistre > Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre);
string cheminCeAppMgr = (string)cleRegistre.GetValue("");

// Lancer l'application avec son argument :
System.Diagnostics.Process.Start(cheminCeAppMgr, """ +argIni+ """);
}

Vb.NET

Et moi je l'ai traduit comme ca mais quel est le type de l'argument passé
en
parametre dans la fonction. Quelq'un à une idée ? Et si vous voyez des
erreurs ailleur dite le moi.
Public Overloads Function install(ByVal IDictionary)

'Récupération du chemin d'accès du fichier .ini:

Dim cheminExe As String > System.Reflection.Assembly.GetExecutingAssembly().Location

Dim cheminRep As String = System.IO.Path.GetDirectoryName(cheminExe)

Dim argIni As String = cheminRep + "InstallSupplementairePPC.ini"

' Récupération du chemin d'accès du fichier CEAppMgr.exe :

Dim cheminBaseDeRegistre As String > "SoftwareMicrosoftWindowsCurrentVersion" + "App
PathsCeAppMgr.exe"

'Microsoft.Win32.RegistryKey()

Dim cleRegistre As Microsoft.Win32.RegistryKey > Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre)

Dim cheminCeAppMgr As String = CType(cleRegistre.GetValue(""), String)

'Lancer l'application avec son argument :

System.Diagnostics.Process.Start(cheminCeAppMgr, """ +argIni+ " "")

End Function





Et ma deuxieme fonction

C#

public override void Uninstall(IDictionary savedState)
{
// Récupération du chemin d'accès du fichier CEAppMgr.exe :
string cheminBaseDeRegistre > "SoftwareMicrosoftWindowsCurrentVersion" +
"App PathsCEAppMgr.exe";
Microsoft.Win32.RegistryKey cleRegistre > Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre);
string cheminCEAppMgr = (string)cleRegistre.GetValue("");
// Lancer l'application sans argument (desinstallation) :
System.Diagnostics.Process.Start(cheminCEAppMgr);
}

VB.NET

Et j'ai le meme pb. Que dois je mettre comme type pour l'arguement passer
en
parametre ?

Public Overloads Function Uninstall(ByVal IDictionary)

'Récupération du chemin d'accès du fichier CEAppMgr.exe :

Dim cheminBaseDeRegistre As String > "SoftwareMicrosoftWindowsCurrentVersion" + "App
PathsCEAppMgr.exe"

Dim cleRegistre As Microsoft.Win32.RegistryKey > Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre)

Dim cheminCEAppMgr As String = CType(cleRegistre.GetValue(""), String)

'Lancer l'application sans argument (desinstallation) :

System.Diagnostics.Process.Start(cheminCEAppMgr)

End Function





Avatar
Matteo
IDictionary c'est un type ?


public override void Install(IDictionary stateSaver)

Je comprends pas la declaration de cette fonction .... IDictionnayry c'est
quoi ? une interface ? ....Et stateSaver ça correspond à quoi ?

PS : je suis debutant en vb.net


"VANNESTE Xavier" a écrit dans le message de
news:
tu nomme pas ton parametre?
byval toto as IDictionary
"Matteo" a écrit dans le message de news:
d2b3i8$b1u$
> Bonjour je dois traduire les deux fonction suivante en vb.net
>
> C#
>
> public override void Install(IDictionary stateSaver)
> {
> // Récupération du chemin d'accès du fichier .ini:
> string cheminExe > > System.Reflection.Assembly.GetExecutingAssembly().Location;
> string cheminRep = System.IO.Path.GetDirectoryName(cheminExe);
> string argIni = cheminRep + "InstallSupplementairePPC.ini";
>
> // Récupération du chemin d'accès du fichier CEAppMgr.exe :
> string cheminBaseDeRegistre > > "SoftwareMicrosoftWindowsCurrentVersion" +
> "App PathsCeAppMgr.exe";
> Microsoft.Win32.RegistryKey cleRegistre > >


Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre);
> string cheminCeAppMgr = (string)cleRegistre.GetValue("");
>
> // Lancer l'application avec son argument :
> System.Diagnostics.Process.Start(cheminCeAppMgr, """ +argIni+ """);
> }
>
> Vb.NET
>
> Et moi je l'ai traduit comme ca mais quel est le type de l'argument


passé
> en
> parametre dans la fonction. Quelq'un à une idée ? Et si vous voyez des
> erreurs ailleur dite le moi.
> Public Overloads Function install(ByVal IDictionary)
>
> 'Récupération du chemin d'accès du fichier .ini:
>
> Dim cheminExe As String > > System.Reflection.Assembly.GetExecutingAssembly().Location
>
> Dim cheminRep As String = System.IO.Path.GetDirectoryName(cheminExe)
>
> Dim argIni As String = cheminRep + "InstallSupplementairePPC.ini"
>
> ' Récupération du chemin d'accès du fichier CEAppMgr.exe :
>
> Dim cheminBaseDeRegistre As String > > "SoftwareMicrosoftWindowsCurrentVersion" + "App
> PathsCeAppMgr.exe"
>
> 'Microsoft.Win32.RegistryKey()
>
> Dim cleRegistre As Microsoft.Win32.RegistryKey > > Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre)
>
> Dim cheminCeAppMgr As String = CType(cleRegistre.GetValue(""),


String)
>
> 'Lancer l'application avec son argument :
>
> System.Diagnostics.Process.Start(cheminCeAppMgr, """ +argIni+ "


"")
>
> End Function
>
>
>
>
>
> Et ma deuxieme fonction
>
> C#
>
> public override void Uninstall(IDictionary savedState)
> {
> // Récupération du chemin d'accès du fichier CEAppMgr.exe :
> string cheminBaseDeRegistre > > "SoftwareMicrosoftWindowsCurrentVersion" +
> "App PathsCEAppMgr.exe";
> Microsoft.Win32.RegistryKey cleRegistre > >


Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre);
> string cheminCEAppMgr = (string)cleRegistre.GetValue("");
> // Lancer l'application sans argument (desinstallation) :
> System.Diagnostics.Process.Start(cheminCEAppMgr);
> }
>
> VB.NET
>
> Et j'ai le meme pb. Que dois je mettre comme type pour l'arguement


passer
> en
> parametre ?
>
> Public Overloads Function Uninstall(ByVal IDictionary)
>
> 'Récupération du chemin d'accès du fichier CEAppMgr.exe :
>
> Dim cheminBaseDeRegistre As String > > "SoftwareMicrosoftWindowsCurrentVersion" + "App
> PathsCEAppMgr.exe"
>
> Dim cleRegistre As Microsoft.Win32.RegistryKey > > Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre)
>
> Dim cheminCEAppMgr As String = CType(cleRegistre.GetValue(""),


String)
>
> 'Lancer l'application sans argument (desinstallation) :
>
> System.Diagnostics.Process.Start(cheminCEAppMgr)
>
> End Function
>
>
>





Avatar
VANNESTE Xavier
IDictionnary est une interface stateServer sera l'objet qui implemente
l'interface en gros dans cette fonction on peut passer toute objet qui
implement IDictionnary
mais IDictionary peut etre assimilé a un type comme une class ou une
structure
"Matteo" a écrit dans le message de news:
d2b70t$d65$
IDictionary c'est un type ?


public override void Install(IDictionary stateSaver)

Je comprends pas la declaration de cette fonction .... IDictionnayry c'est
quoi ? une interface ? ....Et stateSaver ça correspond à quoi ?

PS : je suis debutant en vb.net


"VANNESTE Xavier" a écrit dans le message de
news:
tu nomme pas ton parametre?
byval toto as IDictionary
"Matteo" a écrit dans le message de news:
d2b3i8$b1u$
> Bonjour je dois traduire les deux fonction suivante en vb.net
>
> C#
>
> public override void Install(IDictionary stateSaver)
> {
> // Récupération du chemin d'accès du fichier .ini:
> string cheminExe >> > System.Reflection.Assembly.GetExecutingAssembly().Location;
> string cheminRep = System.IO.Path.GetDirectoryName(cheminExe);
> string argIni = cheminRep + "InstallSupplementairePPC.ini";
>
> // Récupération du chemin d'accès du fichier CEAppMgr.exe :
> string cheminBaseDeRegistre >> > "SoftwareMicrosoftWindowsCurrentVersion" +
> "App PathsCeAppMgr.exe";
> Microsoft.Win32.RegistryKey cleRegistre >> >


Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre);
> string cheminCeAppMgr = (string)cleRegistre.GetValue("");
>
> // Lancer l'application avec son argument :
> System.Diagnostics.Process.Start(cheminCeAppMgr, """ +argIni+
> """);
> }
>
> Vb.NET
>
> Et moi je l'ai traduit comme ca mais quel est le type de l'argument


passé
> en
> parametre dans la fonction. Quelq'un à une idée ? Et si vous voyez des
> erreurs ailleur dite le moi.
> Public Overloads Function install(ByVal IDictionary)
>
> 'Récupération du chemin d'accès du fichier .ini:
>
> Dim cheminExe As String >> > System.Reflection.Assembly.GetExecutingAssembly().Location
>
> Dim cheminRep As String = System.IO.Path.GetDirectoryName(cheminExe)
>
> Dim argIni As String = cheminRep + "InstallSupplementairePPC.ini"
>
> ' Récupération du chemin d'accès du fichier CEAppMgr.exe :
>
> Dim cheminBaseDeRegistre As String >> > "SoftwareMicrosoftWindowsCurrentVersion" + "App
> PathsCeAppMgr.exe"
>
> 'Microsoft.Win32.RegistryKey()
>
> Dim cleRegistre As Microsoft.Win32.RegistryKey >> > Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre)
>
> Dim cheminCeAppMgr As String = CType(cleRegistre.GetValue(""),


String)
>
> 'Lancer l'application avec son argument :
>
> System.Diagnostics.Process.Start(cheminCeAppMgr, """ +argIni+ "


"")
>
> End Function
>
>
>
>
>
> Et ma deuxieme fonction
>
> C#
>
> public override void Uninstall(IDictionary savedState)
> {
> // Récupération du chemin d'accès du fichier CEAppMgr.exe :
> string cheminBaseDeRegistre >> > "SoftwareMicrosoftWindowsCurrentVersion" +
> "App PathsCEAppMgr.exe";
> Microsoft.Win32.RegistryKey cleRegistre >> >


Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre);
> string cheminCEAppMgr = (string)cleRegistre.GetValue("");
> // Lancer l'application sans argument (desinstallation) :
> System.Diagnostics.Process.Start(cheminCEAppMgr);
> }
>
> VB.NET
>
> Et j'ai le meme pb. Que dois je mettre comme type pour l'arguement


passer
> en
> parametre ?
>
> Public Overloads Function Uninstall(ByVal IDictionary)
>
> 'Récupération du chemin d'accès du fichier CEAppMgr.exe :
>
> Dim cheminBaseDeRegistre As String >> > "SoftwareMicrosoftWindowsCurrentVersion" + "App
> PathsCEAppMgr.exe"
>
> Dim cleRegistre As Microsoft.Win32.RegistryKey >> > Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre)
>
> Dim cheminCEAppMgr As String = CType(cleRegistre.GetValue(""),


String)
>
> 'Lancer l'application sans argument (desinstallation) :
>
> System.Diagnostics.Process.Start(cheminCEAppMgr)
>
> End Function
>
>
>









Avatar
Matteo
Donc je dois pouvoir faire
Public Overloads Function install(ByVal stateServer as IDictionary)

Mais dans mon cas il me reconnais pas IDictionary. T'as une idée ?


"VANNESTE Xavier" a écrit dans le message de
news:
IDictionnary est une interface stateServer sera l'objet qui implemente
l'interface en gros dans cette fonction on peut passer toute objet qui
implement IDictionnary
mais IDictionary peut etre assimilé a un type comme une class ou une
structure
"Matteo" a écrit dans le message de news:
d2b70t$d65$
> IDictionary c'est un type ?
>
>
> public override void Install(IDictionary stateSaver)
>
> Je comprends pas la declaration de cette fonction .... IDictionnayry


c'est
> quoi ? une interface ? ....Et stateSaver ça correspond à quoi ?
>
> PS : je suis debutant en vb.net
>
>
> "VANNESTE Xavier" a écrit dans le message de
> news:
>> tu nomme pas ton parametre?
>> byval toto as IDictionary
>> "Matteo" a écrit dans le message de news:
>> d2b3i8$b1u$
>> > Bonjour je dois traduire les deux fonction suivante en vb.net
>> >
>> > C#
>> >
>> > public override void Install(IDictionary stateSaver)
>> > {
>> > // Récupération du chemin d'accès du fichier .ini:
>> > string cheminExe > >> > System.Reflection.Assembly.GetExecutingAssembly().Location;
>> > string cheminRep = System.IO.Path.GetDirectoryName(cheminExe);
>> > string argIni = cheminRep + "InstallSupplementairePPC.ini";
>> >
>> > // Récupération du chemin d'accès du fichier CEAppMgr.exe :
>> > string cheminBaseDeRegistre > >> > "SoftwareMicrosoftWindowsCurrentVersion" +
>> > "App PathsCeAppMgr.exe";
>> > Microsoft.Win32.RegistryKey cleRegistre > >> >
> Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre);
>> > string cheminCeAppMgr = (string)cleRegistre.GetValue("");
>> >
>> > // Lancer l'application avec son argument :
>> > System.Diagnostics.Process.Start(cheminCeAppMgr, """ +argIni+
>> > """);
>> > }
>> >
>> > Vb.NET
>> >
>> > Et moi je l'ai traduit comme ca mais quel est le type de l'argument
> passé
>> > en
>> > parametre dans la fonction. Quelq'un à une idée ? Et si vous voyez


des
>> > erreurs ailleur dite le moi.
>> > Public Overloads Function install(ByVal IDictionary)
>> >
>> > 'Récupération du chemin d'accès du fichier .ini:
>> >
>> > Dim cheminExe As String > >> > System.Reflection.Assembly.GetExecutingAssembly().Location
>> >
>> > Dim cheminRep As String System.IO.Path.GetDirectoryName(cheminExe)
>> >
>> > Dim argIni As String = cheminRep +


"InstallSupplementairePPC.ini"
>> >
>> > ' Récupération du chemin d'accès du fichier CEAppMgr.exe :
>> >
>> > Dim cheminBaseDeRegistre As String > >> > "SoftwareMicrosoftWindowsCurrentVersion" + "App
>> > PathsCeAppMgr.exe"
>> >
>> > 'Microsoft.Win32.RegistryKey()
>> >
>> > Dim cleRegistre As Microsoft.Win32.RegistryKey > >> >


Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre)
>> >
>> > Dim cheminCeAppMgr As String = CType(cleRegistre.GetValue(""),
> String)
>> >
>> > 'Lancer l'application avec son argument :
>> >
>> > System.Diagnostics.Process.Start(cheminCeAppMgr, """ +argIni+ "
> "")
>> >
>> > End Function
>> >
>> >
>> >
>> >
>> >
>> > Et ma deuxieme fonction
>> >
>> > C#
>> >
>> > public override void Uninstall(IDictionary savedState)
>> > {
>> > // Récupération du chemin d'accès du fichier CEAppMgr.exe :
>> > string cheminBaseDeRegistre > >> > "SoftwareMicrosoftWindowsCurrentVersion" +
>> > "App PathsCEAppMgr.exe";
>> > Microsoft.Win32.RegistryKey cleRegistre > >> >
> Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre);
>> > string cheminCEAppMgr = (string)cleRegistre.GetValue("");
>> > // Lancer l'application sans argument (desinstallation) :
>> > System.Diagnostics.Process.Start(cheminCEAppMgr);
>> > }
>> >
>> > VB.NET
>> >
>> > Et j'ai le meme pb. Que dois je mettre comme type pour l'arguement
> passer
>> > en
>> > parametre ?
>> >
>> > Public Overloads Function Uninstall(ByVal IDictionary)
>> >
>> > 'Récupération du chemin d'accès du fichier CEAppMgr.exe :
>> >
>> > Dim cheminBaseDeRegistre As String > >> > "SoftwareMicrosoftWindowsCurrentVersion" + "App
>> > PathsCEAppMgr.exe"
>> >
>> > Dim cleRegistre As Microsoft.Win32.RegistryKey > >> >


Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre)
>> >
>> > Dim cheminCEAppMgr As String = CType(cleRegistre.GetValue(""),
> String)
>> >
>> > 'Lancer l'application sans argument (desinstallation) :
>> >
>> > System.Diagnostics.Process.Start(cheminCEAppMgr)
>> >
>> > End Function
>> >
>> >
>> >
>>
>>
>>
>
>




Avatar
VANNESTE Xavier
as tu mis
imports system.collection

"Matteo" a écrit dans le message de news:
d2b9pg$elo$
Donc je dois pouvoir faire
Public Overloads Function install(ByVal stateServer as IDictionary)

Mais dans mon cas il me reconnais pas IDictionary. T'as une idée ?


"VANNESTE Xavier" a écrit dans le message de
news:
IDictionnary est une interface stateServer sera l'objet qui implemente
l'interface en gros dans cette fonction on peut passer toute objet qui
implement IDictionnary
mais IDictionary peut etre assimilé a un type comme une class ou une
structure
"Matteo" a écrit dans le message de news:
d2b70t$d65$
> IDictionary c'est un type ?
>
>
> public override void Install(IDictionary stateSaver)
>
> Je comprends pas la declaration de cette fonction .... IDictionnayry


c'est
> quoi ? une interface ? ....Et stateSaver ça correspond à quoi ?
>
> PS : je suis debutant en vb.net
>
>
> "VANNESTE Xavier" a écrit dans le message de
> news:
>> tu nomme pas ton parametre?
>> byval toto as IDictionary
>> "Matteo" a écrit dans le message de news:
>> d2b3i8$b1u$
>> > Bonjour je dois traduire les deux fonction suivante en vb.net
>> >
>> > C#
>> >
>> > public override void Install(IDictionary stateSaver)
>> > {
>> > // Récupération du chemin d'accès du fichier .ini:
>> > string cheminExe >> >> > System.Reflection.Assembly.GetExecutingAssembly().Location;
>> > string cheminRep = System.IO.Path.GetDirectoryName(cheminExe);
>> > string argIni = cheminRep + "InstallSupplementairePPC.ini";
>> >
>> > // Récupération du chemin d'accès du fichier CEAppMgr.exe :
>> > string cheminBaseDeRegistre >> >> > "SoftwareMicrosoftWindowsCurrentVersion" +
>> > "App PathsCeAppMgr.exe";
>> > Microsoft.Win32.RegistryKey cleRegistre >> >> >
> Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre);
>> > string cheminCeAppMgr = (string)cleRegistre.GetValue("");
>> >
>> > // Lancer l'application avec son argument :
>> > System.Diagnostics.Process.Start(cheminCeAppMgr, """ +argIni+
>> > """);
>> > }
>> >
>> > Vb.NET
>> >
>> > Et moi je l'ai traduit comme ca mais quel est le type de l'argument
> passé
>> > en
>> > parametre dans la fonction. Quelq'un à une idée ? Et si vous voyez


des
>> > erreurs ailleur dite le moi.
>> > Public Overloads Function install(ByVal IDictionary)
>> >
>> > 'Récupération du chemin d'accès du fichier .ini:
>> >
>> > Dim cheminExe As String >> >> > System.Reflection.Assembly.GetExecutingAssembly().Location
>> >
>> > Dim cheminRep As String > System.IO.Path.GetDirectoryName(cheminExe)
>> >
>> > Dim argIni As String = cheminRep +


"InstallSupplementairePPC.ini"
>> >
>> > ' Récupération du chemin d'accès du fichier CEAppMgr.exe :
>> >
>> > Dim cheminBaseDeRegistre As String >> >> > "SoftwareMicrosoftWindowsCurrentVersion" + "App
>> > PathsCeAppMgr.exe"
>> >
>> > 'Microsoft.Win32.RegistryKey()
>> >
>> > Dim cleRegistre As Microsoft.Win32.RegistryKey >> >> >


Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre)
>> >
>> > Dim cheminCeAppMgr As String = CType(cleRegistre.GetValue(""),
> String)
>> >
>> > 'Lancer l'application avec son argument :
>> >
>> > System.Diagnostics.Process.Start(cheminCeAppMgr, """ +argIni+ "
>> >
> "")
>> >
>> > End Function
>> >
>> >
>> >
>> >
>> >
>> > Et ma deuxieme fonction
>> >
>> > C#
>> >
>> > public override void Uninstall(IDictionary savedState)
>> > {
>> > // Récupération du chemin d'accès du fichier CEAppMgr.exe :
>> > string cheminBaseDeRegistre >> >> > "SoftwareMicrosoftWindowsCurrentVersion" +
>> > "App PathsCEAppMgr.exe";
>> > Microsoft.Win32.RegistryKey cleRegistre >> >> >
> Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre);
>> > string cheminCEAppMgr = (string)cleRegistre.GetValue("");
>> > // Lancer l'application sans argument (desinstallation) :
>> > System.Diagnostics.Process.Start(cheminCEAppMgr);
>> > }
>> >
>> > VB.NET
>> >
>> > Et j'ai le meme pb. Que dois je mettre comme type pour l'arguement
> passer
>> > en
>> > parametre ?
>> >
>> > Public Overloads Function Uninstall(ByVal IDictionary)
>> >
>> > 'Récupération du chemin d'accès du fichier CEAppMgr.exe :
>> >
>> > Dim cheminBaseDeRegistre As String >> >> > "SoftwareMicrosoftWindowsCurrentVersion" + "App
>> > PathsCEAppMgr.exe"
>> >
>> > Dim cleRegistre As Microsoft.Win32.RegistryKey >> >> >


Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre)
>> >
>> > Dim cheminCEAppMgr As String = CType(cleRegistre.GetValue(""),
> String)
>> >
>> > 'Lancer l'application sans argument (desinstallation) :
>> >
>> > System.Diagnostics.Process.Start(cheminCEAppMgr)
>> >
>> > End Function
>> >
>> >
>> >
>>
>>
>>
>
>








Avatar
Matteo
Tu as raison Xavier j'avais oublié d'importer l'espace de nom
system.collection.
Merci pour tes réponses.

Bonne journée.

Juste une precision void= sub et pas function comme j'ai mis dans mon
message precedent.

"VANNESTE Xavier" a écrit dans le message de
news:
as tu mis
imports system.collection

"Matteo" a écrit dans le message de news:
d2b9pg$elo$
> Donc je dois pouvoir faire
> Public Overloads Function install(ByVal stateServer as IDictionary)
>
> Mais dans mon cas il me reconnais pas IDictionary. T'as une idée ?
>
>
> "VANNESTE Xavier" a écrit dans le message de
> news:
>> IDictionnary est une interface stateServer sera l'objet qui implemente
>> l'interface en gros dans cette fonction on peut passer toute objet qui
>> implement IDictionnary
>> mais IDictionary peut etre assimilé a un type comme une class ou une
>> structure
>> "Matteo" a écrit dans le message de news:
>> d2b70t$d65$
>> > IDictionary c'est un type ?
>> >
>> >
>> > public override void Install(IDictionary stateSaver)
>> >
>> > Je comprends pas la declaration de cette fonction .... IDictionnayry
> c'est
>> > quoi ? une interface ? ....Et stateSaver ça correspond à quoi ?
>> >
>> > PS : je suis debutant en vb.net
>> >
>> >
>> > "VANNESTE Xavier" a écrit dans le message de
>> > news:
>> >> tu nomme pas ton parametre?
>> >> byval toto as IDictionary
>> >> "Matteo" a écrit dans le message de news:
>> >> d2b3i8$b1u$
>> >> > Bonjour je dois traduire les deux fonction suivante en vb.net
>> >> >
>> >> > C#
>> >> >
>> >> > public override void Install(IDictionary stateSaver)
>> >> > {
>> >> > // Récupération du chemin d'accès du fichier .ini:
>> >> > string cheminExe > >> >> > System.Reflection.Assembly.GetExecutingAssembly().Location;
>> >> > string cheminRep = System.IO.Path.GetDirectoryName(cheminExe);
>> >> > string argIni = cheminRep + "InstallSupplementairePPC.ini";
>> >> >
>> >> > // Récupération du chemin d'accès du fichier CEAppMgr.exe :
>> >> > string cheminBaseDeRegistre > >> >> > "SoftwareMicrosoftWindowsCurrentVersion" +
>> >> > "App PathsCeAppMgr.exe";
>> >> > Microsoft.Win32.RegistryKey cleRegistre > >> >> >
>> >


Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre);
>> >> > string cheminCeAppMgr = (string)cleRegistre.GetValue("");
>> >> >
>> >> > // Lancer l'application avec son argument :
>> >> > System.Diagnostics.Process.Start(cheminCeAppMgr, """ +argIni+
>> >> > """);
>> >> > }
>> >> >
>> >> > Vb.NET
>> >> >
>> >> > Et moi je l'ai traduit comme ca mais quel est le type de


l'argument
>> > passé
>> >> > en
>> >> > parametre dans la fonction. Quelq'un à une idée ? Et si vous voyez
> des
>> >> > erreurs ailleur dite le moi.
>> >> > Public Overloads Function install(ByVal IDictionary)
>> >> >
>> >> > 'Récupération du chemin d'accès du fichier .ini:
>> >> >
>> >> > Dim cheminExe As String > >> >> > System.Reflection.Assembly.GetExecutingAssembly().Location
>> >> >
>> >> > Dim cheminRep As String > > System.IO.Path.GetDirectoryName(cheminExe)
>> >> >
>> >> > Dim argIni As String = cheminRep +
> "InstallSupplementairePPC.ini"
>> >> >
>> >> > ' Récupération du chemin d'accès du fichier CEAppMgr.exe :
>> >> >
>> >> > Dim cheminBaseDeRegistre As String > >> >> > "SoftwareMicrosoftWindowsCurrentVersion" + "App
>> >> > PathsCeAppMgr.exe"
>> >> >
>> >> > 'Microsoft.Win32.RegistryKey()
>> >> >
>> >> > Dim cleRegistre As Microsoft.Win32.RegistryKey > >> >> >
> Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre)
>> >> >
>> >> > Dim cheminCeAppMgr As String = CType(cleRegistre.GetValue(""),
>> > String)
>> >> >
>> >> > 'Lancer l'application avec son argument :
>> >> >
>> >> > System.Diagnostics.Process.Start(cheminCeAppMgr, """ +argIni+


"
>> >> >
>> > "")
>> >> >
>> >> > End Function
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > Et ma deuxieme fonction
>> >> >
>> >> > C#
>> >> >
>> >> > public override void Uninstall(IDictionary savedState)
>> >> > {
>> >> > // Récupération du chemin d'accès du fichier CEAppMgr.exe :
>> >> > string cheminBaseDeRegistre > >> >> > "SoftwareMicrosoftWindowsCurrentVersion" +
>> >> > "App PathsCEAppMgr.exe";
>> >> > Microsoft.Win32.RegistryKey cleRegistre > >> >> >
>> >


Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre);
>> >> > string cheminCEAppMgr = (string)cleRegistre.GetValue("");
>> >> > // Lancer l'application sans argument (desinstallation) :
>> >> > System.Diagnostics.Process.Start(cheminCEAppMgr);
>> >> > }
>> >> >
>> >> > VB.NET
>> >> >
>> >> > Et j'ai le meme pb. Que dois je mettre comme type pour l'arguement
>> > passer
>> >> > en
>> >> > parametre ?
>> >> >
>> >> > Public Overloads Function Uninstall(ByVal IDictionary)
>> >> >
>> >> > 'Récupération du chemin d'accès du fichier CEAppMgr.exe :
>> >> >
>> >> > Dim cheminBaseDeRegistre As String > >> >> > "SoftwareMicrosoftWindowsCurrentVersion" + "App
>> >> > PathsCEAppMgr.exe"
>> >> >
>> >> > Dim cleRegistre As Microsoft.Win32.RegistryKey > >> >> >
> Microsoft.Win32.Registry.LocalMachine.OpenSubKey(cheminBaseDeRegistre)
>> >> >
>> >> > Dim cheminCEAppMgr As String = CType(cleRegistre.GetValue(""),
>> > String)
>> >> >
>> >> > 'Lancer l'application sans argument (desinstallation) :
>> >> >
>> >> > System.Diagnostics.Process.Start(cheminCEAppMgr)
>> >> >
>> >> > End Function
>> >> >
>> >> >
>> >> >
>> >>
>> >>
>> >>
>> >
>> >
>>
>>
>
>