Sentynel
Messages postés85Date d'inscriptionjeudi 7 janvier 2010StatutMembreDernière intervention13 juillet 2013
-
25 juil. 2011 à 17:32
Sentynel
Messages postés85Date d'inscriptionjeudi 7 janvier 2010StatutMembreDernière intervention13 juillet 2013
-
28 juil. 2011 à 21:09
Bonjour,
voulant faire un système multi-threading sur mon logiciel pour eviter que celui-ci "freeze" lors d'un acces à une base de données, Visual Studio m'affiche que cette commande est obsolete depuis .net framework 4.0.
les commandes sont thread.suspend et thread.resume
Est ce que quelqu'un pourrai m'aider svp ?
Sub DownloadProcess()
If My.Computer.FileSystem.FileExists(Application.StartupPath & "\TheAPP.exe") = True Then
My.Computer.FileSystem.DeleteFile(Application.StartupPath & "\TheAPP.exe")
End If
Thread2 = New System.Threading.Thread(AddressOf DownloadFiles)
Thread2.Start()
Thread.Suspend()
If My.Computer.FileSystem.FileExists(Application.StartupPath & "" & Label1.Text) = True Then
My.Computer.FileSystem.DeleteFile(Application.StartupPath & "" & Label1.Text)
End If
My.Computer.FileSystem.RenameFile("TheAPP.exe", Label1.Text)
If CheckBox1.Checked = True Then
Dim wsh As Object = CreateObject("WScript.Shell")
Dim MyShortcut, DesktopPath
wsh = CreateObject("WScript.Shell")
DesktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
MyShortcut = wsh.CreateShortcut(DesktopPath & "\Savegame Manager 2 BETA.lnk")
MyShortcut.TargetPath = wsh.ExpandEnvironmentStrings(Application.StartupPath & "" & System.IO.Path.GetFileName(Application.ExecutablePath))
MyShortcut.WorkingDirectory = wsh.ExpandEnvironmentStrings(Application.StartupPath)
MyShortcut.WindowStyle = 4
MyShortcut.Save()
End If
Button2.Text = "Downloaded"
Thread.Abort()
End Sub
Sub DownloadFiles()
My.Computer.Network.DownloadFile("http://dl.dropbox.com/u/24209719/Savegame%20Manager/SGMnewver.exe", Application.StartupPath & "\TheAPP.exe")
Thread.Resume()
Thread2.Abort()
End Sub