Bonjour,
J'ai crée un programme qui met les fichier d'un autre programme ( GTA5, FiveM ) à jour à l'aide d'un lien de téléchargement Mediafire.
Mais le problème c'est que je possède une TextBox avec à l'intérieur le répertoire ou decompresser les fichier d'update pour GTA5, mais le bémol ce que dans ce répertoire il y a des espace et cela ne fonctionne donc pas.
Comment faire, car j'ai tester de faire dans un autre répertoire bidon mais qui ne possède pas d'espace et cela fonctionne.
Ou alors procéder autrement mais je ne sais pas comment.
Merci
Voici le code du Module_Unrar.vb
Et le code concerner pour form1
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 Module Module_unrar Sub UnRar(ByVal WorkingDirectory As String, ByVal filepath As String) ' Microsoft.Win32 and System.Diagnostics namespaces are imported Dim objRegKey As Microsoft.Win32.RegistryKey objRegKey = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey("WinRAR\Shell\Open\Command") ' Windows 7 Registry entry for WinRAR Open Command Dim obj As Object = objRegKey.GetValue("") Dim objRarPath As String = obj.ToString() objRarPath = objRarPath.Substring(1, objRarPath.Length - 7) objRegKey.Close() Dim objArguments As String ' in the following format ' " X G:\Downloads\samplefile.rar G:\Downloads\sampleextractfolder\" objArguments = " X " & " " & filepath & " " + " " + WorkingDirectory Dim objStartInfo As New ProcessStartInfo() ' Set the UseShellExecute property of StartInfo object to FALSE ' Otherwise the we can get the following error message ' The Process object must have the UseShellExecute property set to false in order to use environment variables. objStartInfo.UseShellExecute = False objStartInfo.FileName = objRarPath objStartInfo.Arguments = objArguments objStartInfo.WindowStyle = ProcessWindowStyle.Hidden objStartInfo.WorkingDirectory = WorkingDirectory & "\" Dim objProcess As New Process() objProcess.StartInfo = objStartInfo objProcess.Start() End Sub End Module
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 Private Sub btnUnrar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUnrar.Click If TextBox1.Text = "" Or TextBox2.Text = "" Then MsgBox("Veuillez remplir toutes les cases demander pour le bon fonctionnement de la mise à jour", MsgBoxStyle.Critical, ("Erreur")) Else Module_unrar.UnRar(TextBox1.Text, "C:\UpdateXXXX\FiveM_Application_Data.rar") Module_unrar.UnRar(TextBox2.Text, "C:\UpdateXXXX\Grand_Theft_Auto_V.rar") End If End Sub
Partager