IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

VB.NET Discussion :

Erreur sur Process.Start [Débutant]


Sujet :

VB.NET

  1. #1
    Membre du Club
    Homme Profil pro
    fouineur sa existe?
    Inscrit en
    Juin 2012
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : fouineur sa existe?
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juin 2012
    Messages : 6
    Par défaut Erreur sur Process.Start
    Bonjour jai un petit probleme depuis plusieur jour regarder mon code!

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    Imports System.Net
     
    Public Class Form1
        Dim WithEvents WC As New WebClient
        Dim WithEvents WD As New WebClient
        Dim WithEvents WE As New WebClient
     
     
     
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            If System.IO.File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\Upgrader.txt") = True Then
                'Remplacer "votresite" par l'adresse de votre site/ftp ou stocker les fichiers nécessaire a la Mise a jour
                My.Computer.Network.DownloadFile("http://ftp://antchain@hotmail.fr.344@kerta.dedicraft.fr/Upgrader.txt", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\Upgrader.txt")
                Dim vn As New System.IO.StreamReader(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\Upgrader.txt")
                Dim vni As New System.IO.StreamReader(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\Upgrader.txt")
                Dim nk As String
                Dim nki As String
                nk = vn.ReadLine
                nki = vni.ReadLine
                vn.Close()
                vni.Close()
                Kill(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\Upgrader.txt")
                If nk < nki Then
                    MsgBox("Une mise a jour est disponible.", MsgBoxStyle.Information)
                    Button2.PerformClick()
                End If
            End If
            If System.IO.File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\Upgrader.txt") = False Then
                'Remplacer "votresite" par l'adresse de votre site/ftp ou stocker les fichiers nécessaire a la Mise a jour
                My.Computer.Network.DownloadFile("http://ftp://antchain@hotmail.fr.344@kerta.dedicraft.fr/Upgrader.txt", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\Upgrader.txt")
                MsgBox("Installation des fichiers necessaire au fonctionnement.", MsgBoxStyle.Information)
                Button2.PerformClick()
            End If
            If System.IO.File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\minecraft.exe") = False Then
                MsgBox("Installation des fichiers necessaire au fonctionnement.", MsgBoxStyle.Information)
                Button2.PerformClick()
            End If
            If System.IO.File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\loglogin.txt") = True Then
                CheckBox1.Checked = True
                Dim sr As New System.IO.StreamReader(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\loglogin.txt")
                TextBox1.Text = sr.ReadLine
                TextBox2.Text = sr.ReadLine
                sr.Close()
            End If
            ProgressBar1.Minimum = 0
            ProgressBar1.Maximum = 100
            ProgressBar1.Value = 0
        End Sub
     
        Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
     
        End Sub
     
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            If CheckBox1.Checked = True Then
                If System.IO.File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\loglogin.txt") = True Then
                    Kill(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\loglogin.txt")
                End If
                Dim sw As New System.IO.StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\loglogin.txt")
                sw.WriteLine(TextBox1.Text)
                sw.WriteLine(TextBox2.Text)
                sw.Close()
                'Remplacer "Votre Serveur" par l'ip:port de votre serveur (par exemple " 111.111.111.111:8888" ) Surtout Laissez L'espace entre " et l'adresse ip  
                Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\minecraft.exe", TextBox1.Text & " " & TextBox2.Text & " kerta.dedicraft.fr")
            Else
                If System.IO.File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\loglogin.txt") = True Then
                    Kill(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\loglogin.txt")
                End If
                'Remplacer "Votre Serveur" par l'ip:port de votre serveur (par exemple " 111.111.111.111:8888" ) Surtout Laissez L'espace entre " et l'adresse ip  
                Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\minecraft.exe", TextBox1.Text & " " & TextBox2.Text & " kerta.dedicraft.fr")
            End If
        End Sub
     
        Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
     
        End Sub
     
        Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
     
        End Sub
     
        Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label2.Click
     
        End Sub
     
        Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
     
        End Sub
     
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            MsgBox("Pensez a fermer Minecraft et attendez le message de confirmation!", MsgBoxStyle.Information)
            Button1.Enabled = False
            Button2.Enabled = False
            'Remplacer "votresite" par l'adresse de votre site/ftp ou stocker les fichiers nécessaire a la Mise a jour
            WC.DownloadFileAsync(New Uri("http://ftp://antchain@hotmail.fr.344@kerta.dedicraft.fr/minecraft.jar"), Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\minecraft.jar")
        End Sub
     
        Private Sub ProgressBar1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProgressBar1.Click
     
        End Sub
     
        Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
     
        End Sub
     
        Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs)
     
        End Sub
     
        Private Sub WebBrowser2_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser2.DocumentCompleted
     
        End Sub
        Private Sub WebBrowser2_Navigating(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserNavigatingEventArgs) Handles WebBrowser2.Navigating
            'Remplacer "votresite" par l'adresse de votre site/ftp ou stocker les fichiers nécessaire a la Mise a jour
            If (e.Url.ToString() = "http://ftp://antchain@hotmail.fr.344@kerta.dedicraft.fr/News.htm") Then
     
            Else
                'Remplacer "votresite" par l'adresse de votre site/ftp ou stocker les fichiers nécessaire a la Mise a jour
                If (e.Url.ToString() = "http://ftp://antchain@hotmail.fr.344@kerta.dedicraft.fr/Minecraft Update News_files/iframe.htm") Then
     
                Else
                    e.Cancel = True
                    System.Diagnostics.Process.Start(e.Url.ToString())
                End If
            End If
     
        End Sub
     
        Private Sub Label3_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs)
     
        End Sub
        Private Sub WC_DownloadProgressChanged(ByVal sender As Object, ByVal e As DownloadProgressChangedEventArgs) Handles WC.DownloadProgressChanged
            ProgressBar1.Value = 4 * (e.ProgressPercentage) / 6
        End Sub
        Private Sub WC_DownloadFileCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles WC.DownloadFileCompleted
            'Remplacer "votresite" par l'adresse de votre site/ftp ou stocker les fichiers nécessaire a la Mise a jour
            WD.DownloadFileAsync(New Uri("http://ftp://antchain@hotmail.fr.344@kerta.dedicraft.fr/Upgrader.txt"), Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\Upgrader.txt")
        End Sub
        Private Sub WD_DownloadProgressChanged(ByVal sender As Object, ByVal e As DownloadProgressChangedEventArgs) Handles WD.DownloadProgressChanged
            ProgressBar1.Value = (400 / 6) + (e.ProgressPercentage) / 6
        End Sub
        Private Sub WD_DownloadFileCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles WD.DownloadFileCompleted
            WE.DownloadFileAsync(New Uri("https://s3.amazonaws.com/MinecraftDownload/launcher/Minecraft.exe"), Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\minecraft.exe")
        End Sub
        Private Sub WE_DownloadProgressChanged(ByVal sender As Object, ByVal e As DownloadProgressChangedEventArgs) Handles WE.DownloadProgressChanged
            ProgressBar1.Value = (500 / 6) + (e.ProgressPercentage) / 6
        End Sub
        Private Sub WE_DownloadFileCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles WE.DownloadFileCompleted
            Button1.Enabled = True
            Button2.Enabled = True
            MsgBox("Mise a jour Terminée!", MsgBoxStyle.Information)
        End Sub
    End Class
    J'ai une erreur sur la ligne 70 et je sais vraiment pas il sagit de quoi merci beaucoup si vous pouvez m'aider.

  2. #2
    Membre Expert Avatar de hunteshiva
    Homme Profil pro
    Chef de projet en SSII
    Inscrit en
    Février 2010
    Messages
    1 069
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Chef de projet en SSII
    Secteur : Industrie

    Informations forums :
    Inscription : Février 2010
    Messages : 1 069
    Par défaut
    Bonjour,

    tu dit avoir un problème a la ligne 70, si je me trompe pas c'est celle la?
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\.minecraft\bin\minecraft.exe", TextBox1.Text & " " & TextBox2.Text & " kerta.dedicraft.fr")
            End If
    peux tu nous envoyer l'erreur générée par VS?

    En regardant un peu, il est p-e plus simple a comprendre de d'écrire ton process comme ceci:
    (surtout qu'on ne sais pas ce que tu met dans TextBox1 et TextBox2)
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    	' One file parameter to the executable
    	Dim sourceName As String = "ExampleText.txt"
    	' The second file parameter to the executable
    	Dim targetName As String = "Example.gz"
    	' New ProcessStartInfo created
    	Dim p As New ProcessStartInfo
     
    	' Specify the location of the binary
    	p.FileName = "C:\7za.exe"
     
    	' Use these arguments for the process
    	p.Arguments = "a -tgzip """ & targetName & """ """ & sourceName & """ -mx=9"
     
    	' Use a hidden window
    	p.WindowStyle = ProcessWindowStyle.Hidden
     
    	' Start the process
    	Process.Start(p)
    Et si tu peux nous mettre la commande que tu cherche à executer,
    on pourra t'aider a l'integrer dans vb.

  3. #3
    Membre du Club
    Homme Profil pro
    fouineur sa existe?
    Inscrit en
    Juin 2012
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : fouineur sa existe?
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juin 2012
    Messages : 6
    Par défaut
    Mmmm tu voudrait pas plutot faire un partage d'écran sur skype? sa serait plus facile a expliquer parceque la tu ma perdu!

  4. #4
    Membre Expert Avatar de hunteshiva
    Homme Profil pro
    Chef de projet en SSII
    Inscrit en
    Février 2010
    Messages
    1 069
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Chef de projet en SSII
    Secteur : Industrie

    Informations forums :
    Inscription : Février 2010
    Messages : 1 069
    Par défaut
    Donne moi la commande que tu veux automatiser sous vb

  5. #5
    Membre du Club
    Homme Profil pro
    fouineur sa existe?
    Inscrit en
    Juin 2012
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : fouineur sa existe?
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juin 2012
    Messages : 6
    Par défaut
    Citation Envoyé par hunteshiva Voir le message
    Donne moi la commande que tu veux automatiser sous vb
    sa mange quoi en hiver sa? Oo tu veux pas plutot que je tenvoie tout le projet?
    jvais faire sa
    Fichiers attachés Fichiers attachés

  6. #6
    Membre Expert Avatar de hunteshiva
    Homme Profil pro
    Chef de projet en SSII
    Inscrit en
    Février 2010
    Messages
    1 069
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Chef de projet en SSII
    Secteur : Industrie

    Informations forums :
    Inscription : Février 2010
    Messages : 1 069
    Par défaut
    Mais ça sert a rien XD,
    ton projet il marche pas, je vais pas le déguger a ta place.

    Tu a essayé de faire une commande sous MS-DOS qui fonctionne?
    Après tu a juste à la rentrer sous vb.

    Perso j'ai un doute sur la virgule qui figure en plein milieux
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    '...'"\.minecraft\bin\minecraft.exe" , TextBox1.Text & '...'

  7. #7
    Membre du Club
    Homme Profil pro
    fouineur sa existe?
    Inscrit en
    Juin 2012
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

    Informations professionnelles :
    Activité : fouineur sa existe?
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juin 2012
    Messages : 6
    Par défaut
    ok merci je vais essayer de faire quelque chose avec sa!

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 2
    Dernier message: 15/10/2013, 09h17
  2. Réponses: 2
    Dernier message: 13/10/2012, 20h07
  3. Réponses: 2
    Dernier message: 28/03/2011, 15h47
  4. Process.Start génère une erreur
    Par jerome.fortias dans le forum C#
    Réponses: 6
    Dernier message: 17/09/2007, 15h31
  5. Erreur sur le TNSListener après installation de 9iAS
    Par Patmane dans le forum Installation
    Réponses: 4
    Dernier message: 04/02/2004, 11h16

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo