j'aimerais remplacer une ligne de commande par un text box,
car la ligne de commande est assembler dans le textbox, puis
j'aimerais qu'il le replace au bonne endroit dans le programme
mais je sais pas comment faire pour que le textbox se place au bon endroit dans mon code? soit qu'il se colle ou avec un module, je sais pas ?
d'avance merci
A voir également:
Comment remplacer une ligne de commande par un textbox ?
Set Adapter = GetObject("winmgmts:Win32_NetworkAdapterConfiguration=18")
ci dessus la commande fonctionne, mais si de le programme je veux mettre autre chose que "18" je ne saurais pas.
Set Adapter = GetObject("winmgmts:Win32_NetworkAdapterConfiguration=" &text1.text )
ci dessus la commande ne fonctionne pas, donc je fais l'assemblage de la commande dans un textbox, mais comment faire pour mettre la commande (le contenu du textbox) la ou doit aller dans le programme
DEMONSTRATION 1: QUE JE NE VEUX PAS AVOIR
Dim Adapter As Object
Dim tmpStr As String
Dim ipaddr As Variant
Dim subnet As Variant
Dim gateway As Variant
Dim tmpVariant As Variant
Dim RetVal As Integer
VOICI LA COMMANDE
Set Adapter = GetObject("winmgmts:Win32_NetworkAdapterConfiguration=18")
'Set your adapter to a static IP address
RetVal = Adapter.EnableStatic(ipaddr, subnet)
If RetVal = 0 Then
'Set your gateway
RetVal = Adapter.setgateways(gateway)
If RetVal = 0 Then
'Set your DNS
RetVal = Adapter.SetDNSDomain("myDnsName")
End If
End If
DEMONSTRATION 2 : JE DESIRERAIS MON PROGRAMME DANS SE GENRE CI
Dim Adapter As Object
Dim tmpStr As String
Dim ipaddr As Variant
Dim subnet As Variant
Dim gateway As Variant
Dim tmpVariant As Variant
Dim RetVal As Integer
A LA PLACE DE LA COMMANDE QUE L'ON VOIE DANS LA DEMO 1, J'AIMERAIS LE CONTENU DU TEXTBOX ICI
'Set your adapter to a static IP address
RetVal = Adapter.EnableStatic(ipaddr, subnet)
If RetVal = 0 Then
'Set your gateway
RetVal = Adapter.setgateways(gateway)
If RetVal = 0 Then
'Set your DNS
RetVal = Adapter.SetDNSDomain("myDnsName")
End If
End If