Hola amigos,
Quisiera saber como puedo reemplazar mi codigo de que en vez que descargue un fichero lo guarde en el my.setting. Lo que hago es que si en el servidor la version no encaja, hace que salte un formulario. ¿Me podrían ayudar?
#Region "Referencias"
Imports System.IO
#End Region
Module ChanVersion
ReadOnly TempFileChannel As String = (My.Computer.FileSystem.SpecialDirectories.Temp &"\version.txt")
ReadOnly DirChannel As String = (Application.StartupPath & "\Channel")
Friend Sub CheckForChannel()
Try
Dim FileChannelVer As String = Application.StartupPath & "\Channel\version.txt"
Dim ChannelVer As String = ""
Dim LastVer As String = ""
If System.IO.File.Exists(FileChannelVer) Then ChannelVer = My.Computer.FileSystem.ReadAllText(FileChannelVer)
If System.IO.File.Exists(TempFileChannel) Then System.IO.File.Delete(TempFileChannel)
Try
My.Computer.Network.DownloadFile("http://miweb.con/version.txt", TempFileChannel)
Catch ex As Exception
Err.Clear()
End Try
If Directory.Exists(DirChannel) = False Then Directory.CreateDirectory(DirChannel)
If System.IO.File.Exists(TempFileChannel) Then LastVer = My.Computer.FileSystem.ReadAllText(TempFileChannel)
If Not ChannelVer = LastVer Then
If System.IO.File.Exists(FileChannelVer) Then System.IO.File.Delete(FileChannelVer)
System.IO.File.Copy(TempFileChannel, FileChannelVer)
Frm_update.Show()
Else
End If
Catch ex As Exception
Err.Clear()
End Try
End Sub
End Module