Vb.net 主机名为';在某些PC上无法解决此错误
因此,我有一个大型的网络浏览器项目,一切似乎都很好。 我有一个功能,允许用户在单击特定按钮时获取有关我的网站的新闻。 它的工作原理是从dropbox中的txt文件中读取文本,然后在我的应用程序中的richtextbox中显示该文本 我这样做的方式是,我只是上传了一个txt文件到我的Dropbox文件夹,给它一个永远不会改变的名称,以便与我的代码一起工作,然后我复制了这个文件的共享链接,并将其放入我的代码中 现在,每当我想更新我的新闻,我所要做的就是编辑我的Dropbox文件夹中的txt文件,保持相同的文件名,使链接保持不变,不发生更改,从而允许我的应用程序正确更新新闻 我在我的笔记本电脑上进行了测试(我在笔记本电脑上进行所有编程),效果非常好。我在我的旧台式电脑上测试了这个,效果很好。我有一些来自世界各地不同国家的朋友测试了这个和这个问题发生的地方。。。这对他们中的一些人来说非常有效,而对其他人来说,它失败了,并给出了一个错误。。。(无法解析主机名) 这不仅使我的应用程序中的news函数不可用,而且还使我没有的自动更新函数也不可用,因为它也使用相同的方法 现在让我们跳转到代码中,请帮助找出问题所在 以下是从Dropbox下载文件的主要代码:Vb.net 主机名为';在某些PC上无法解决此错误,vb.net,download,dropbox,hostname,unresolved-external,Vb.net,Download,Dropbox,Hostname,Unresolved External,因此,我有一个大型的网络浏览器项目,一切似乎都很好。 我有一个功能,允许用户在单击特定按钮时获取有关我的网站的新闻。 它的工作原理是从dropbox中的txt文件中读取文本,然后在我的应用程序中的richtextbox中显示该文本 我这样做的方式是,我只是上传了一个txt文件到我的Dropbox文件夹,给它一个永远不会改变的名称,以便与我的代码一起工作,然后我复制了这个文件的共享链接,并将其放入我的代码中 现在,每当我想更新我的新闻,我所要做的就是编辑我的Dropbox文件夹中的txt文件,保持
Private Sub Download_Dropbox(URL As String, FileName As String)
Dim Data() = HTTP_Get(URL)
File.WriteAllBytes(FileName, Data)
End Sub
Private Function HTTP_Get(Page As String) As Byte()
Dim Request As HttpWebRequest = WebRequest.Create(Page)
Request.Method = "GET"
Request.KeepAlive = True
Request.ContentType = "application/x-www-form-urlencoded"
Request.UserAgent = "Mozilla/5.0 (Windows NT 6.3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36"
Request.AllowAutoRedirect = True
Dim Response As HttpWebResponse = Request.GetResponse()
Dim Data As Stream = Response.GetResponseStream()
Dim Bytes() As Byte
Using Writer As New MemoryStream
Dim Buffer(&HFFF) As Byte
Do
Dim BytesRead As Long = Data.Read(Buffer, 0, Buffer.Length)
If BytesRead > 0 Then Writer.Write(Buffer, 0, BytesRead) Else Exit Do
Loop
Bytes = Writer.ToArray()
End Using
Return Bytes
End Function
这是尝试更新新闻的按钮的代码(读取txt文件):
这是从Dropbox下载文件的代码(应该在程序进行自我更新时发生):
这是表格1中的IsConnectionAvailable()
代码:
Public Function IsConnectionAvailable() As Boolean
Dim objUrl As New System.Uri("http://www.google.com")
Dim objWebReq As System.Net.WebRequest
objWebReq = System.Net.WebRequest.Create(objUrl)
Dim objresp As System.Net.WebResponse
Try
objresp = objWebReq.GetResponse
objresp.Close()
objresp = Nothing
Return True
Catch ex As Exception
objresp = Nothing
objWebReq = Nothing
Return False
End Try
End Function
这是我的更新客户端的全部代码,它完全无法从Dropbox下载任何文件或读取文本:
Option Explicit On
Imports System.IO
Imports System.Net
Imports System.Net.Sockets
Public Class Form1
Dim Listener As New TcpListener(8000)
Dim Client As TcpClient
Dim CurDir As String = My.Application.Info.DirectoryPath
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
updatecheck()
End Sub
Private Sub helper_Click(sender As Object, e As EventArgs) Handles helper.Click
helpform.Show()
End Sub
Public Sub mainupdate()
Download_Dropbox("https://www.dropbox.com/s/eomar7a70hokm0l/Orbit.exe?dl=1", CurDir & "\Orbit.exe")
Download_Dropbox("https://www.dropbox.com/s/ij1qceoe5kr6tmp/Orbit.exe.config?dl=1", CurDir & "\Orbit.exe.config")
Download_Dropbox("https://www.dropbox.com/s/em4mo4lsoswba4p/Orbit.pdb?dl=1", CurDir & "\Orbit.pdb")
Download_Dropbox("https://www.dropbox.com/s/g0361qpzvq74ge4/Orbit.vshost.exe?dl=1", CurDir & "\Orbit.vshost.exe")
Download_Dropbox("https://www.dropbox.com/s/o5bbkn72cbs9bo7/Orbit.vshost.exe.config?dl=1", CurDir & "\Orbit.vshost.exe.config")
Download_Dropbox("https://www.dropbox.com/s/wzsyzjczibwa9sz/Orbit.xml?dl=1", CurDir & "\Orbit.xml")
Download_Dropbox("https://www.dropbox.com/s/l0ogz6kxrn951zv/OWBV.txt?dl=1", CurDir & "\OWBV.txt")
End Sub
Public Sub othersupdate()
Download_Dropbox("https://www.dropbox.com/s/lyv0kdmpi85rbdp/libzplay.dll?dl=1", CurDir & "\libzplay.dll")
End Sub
Public Sub soundsupdate()
Download_Dropbox("https://www.dropbox.com/s/hfl1vidanwecad4/not.wav?dl=1", CurDir & "\not.wav")
Download_Dropbox("https://www.dropbox.com/s/cfroifknr8zmnub/pokked.wav?dl=1", CurDir & "\pokked.wav")
Download_Dropbox("https://www.dropbox.com/s/c73af0a30hxg7gp/screenshotsound.wav?dl=1", CurDir & "\screenshotsound.wav")
Download_Dropbox("https://www.dropbox.com/s/ps5ztudy9cwvwnl/timerend.wav?dl=1", CurDir & "\timerend.wav")
End Sub
Private Sub Download_Dropbox(URL As String, FileName As String)
Dim Data() = HTTP_Get(URL)
File.WriteAllBytes(FileName, Data)
End Sub
Private Function HTTP_Get(Page As String) As Byte()
Dim Request As HttpWebRequest = WebRequest.Create(Page)
Request.Method = "GET"
Request.KeepAlive = True
Request.ContentType = "application/x-www-form-urlencoded"
Request.UserAgent = "Mozilla/5.0 (Windows NT 6.3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36"
Request.AllowAutoRedirect = True
Dim Response As HttpWebResponse = Request.GetResponse()
Dim Data As Stream = Response.GetResponseStream()
Dim Bytes() As Byte
Using Writer As New MemoryStream
Dim Buffer(&HFFF) As Byte
Do
Dim BytesRead As Long = Data.Read(Buffer, 0, Buffer.Length)
If BytesRead > 0 Then Writer.Write(Buffer, 0, BytesRead) Else Exit Do
Loop
Bytes = Writer.ToArray()
End Using
Return Bytes
End Function
Public Function IsConnectionAvailable() As Boolean
Dim objUrl As New System.Uri("http://www.google.com")
Dim objWebReq As System.Net.WebRequest
objWebReq = System.Net.WebRequest.Create(objUrl)
Dim objresp As System.Net.WebResponse
Try
objresp = objWebReq.GetResponse
objresp.Close()
objresp = Nothing
Return True
Catch ex As Exception
objresp = Nothing
objWebReq = Nothing
Return False
End Try
End Function
Public Sub updatecheck()
Try
If IsConnectionAvailable() = True Then
Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://pastebin.com/wCt79dEc")
Dim response As System.Net.HttpWebResponse = request.GetResponse()
Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream())
Dim newestversion As String = sr.ReadToEnd()
Dim fileContents As String
Try
fileContents = My.Computer.FileSystem.ReadAllText(CurDir & "\OWBV.txt")
If newestversion.Contains(fileContents) Then
updater.Enabled = False
Else
End If
Catch ex As Exception
MsgBox("Orbit version file not found. Update button disabled." & "You can do one of the following 2 methods to fix this error. (Administrator rights might be required)" & vbCrLf & "1- Please open Orbit and then head to (Settings) , then check the option (Enable Console) and save changes. " & vbCrLf & "2- Open (File) Menu and launch (Browser Console)" & vbCrLf & "3- Type in the following command without the brackets: ( /vfcreate ) and then press Enter on your keyboard." & vbCrLf & "If the process is successful , then please launch the update client again either through Orbit itself or close Orbit and launch it manually by running (OWBUpdater.exe) in the application directory. " & vbCrLf & "If the process isn't successful , then please contact customer support at: omaradoinc@hotmail.com" & vbCrLf & "The other method to fix this error is:" & vbCrLf & "1- Navigate to Orbit Installation directory/folder." & vbCrLf & "2-Create a notepad (.txt file) and name that file the following name without the brackets: (OWBV)" & vbCrLf & "3- Open the file and type Orbit's old version that you have or as instructed by customer support , save the changes." & vbCrLf & "If you fail to fix this error , please contact customer support at:" & vbCrLf & "omaradoinc@hotmail.com")
updater.Enabled = False
End Try
Else
updater.Enabled = False
repairer.Enabled = False
intnot.Visible = True
Me.Text = "Orbit Web Browser Update Client (No Internet connection)"
End If
Catch ex As Exception
MsgBox("An Error Has Occured While Checking For Updates..." & vbCrLf & "This May Happen Because Of a Load On The Server" & vbCrLf & "Please Try Again Later" & vbCrLf & "If The Problems Still Exists Then Please Report This To:" & vbCrLf & "omaradoinc@hotmail.com")
End Try
End Sub
Private Sub updater_Click(sender As Object, e As EventArgs) Handles updater.Click
Try
m1.Visible = False
m2.Visible = False
progressor.Visible = True
Me.Enabled = False
mainupdate()
Process.Start(CurDir & "\Orbit.exe")
MsgBox("Orbit was successfully updated to the latest version.")
Me.Close()
Catch ex As Exception
m1.Visible = True
m2.Visible = True
progressor.Visible = False
Me.Enabled = True
My.Computer.FileSystem.WriteAllText(CurDir & "\errorlog.txt", ex.ToString, True)
MsgBox("Update failed." & vbCrLf & "A log file was created in the application directory , Please send it to customer support at:" & vbCrLf & "omaradoinc@hotmail.com")
End Try
End Sub
Private Sub repairer_Click(sender As Object, e As EventArgs) Handles repairer.Click
Try
m1.Visible = False
m2.Visible = False
progressor.Visible = True
Me.Enabled = False
othersupdate()
soundsupdate()
Process.Start(CurDir & "\Orbit.exe")
MsgBox("Orbit was successfully repaired.")
Me.Close()
Catch ex As Exception
m1.Visible = True
m2.Visible = True
progressor.Visible = False
Me.Enabled = True
My.Computer.FileSystem.WriteAllText(CurDir & "\errorlog.txt", ex.ToString, True)
MsgBox("Repair failed." & vbCrLf & "A log file was created in the application directory , Please send it to customer support at:" & vbCrLf & "omaradoinc@hotmail.com")
End Try
End Sub
Private Sub remover_Click(sender As Object, e As EventArgs) Handles remover.Click
Try
Listener.Start()
m1.Visible = False
m2.Visible = False
progressor.Visible = True
My.Computer.FileSystem.WriteAllText(CurDir & "\uninstcmd.txt", "cmd:/send\performfactoryreset", True)
Timer1.Enabled = True
Timer1.Start()
Process.Start(CurDir & "\Orbit.exe")
updater.Enabled = False
repairer.Enabled = False
remover.Enabled = False
Catch ex As Exception
Listener.Stop()
Timer1.Stop()
Timer1.Enabled = False
m1.Visible = True
m2.Visible = True
progressor.Visible = False
MsgBox("Orbit.exe wasn't found." & vbCrLf & "Unable to complete uninstallation.")
End Try
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Dim Message As String
Dim nStart As Integer
Dim nLast As Integer
If Listener.Pending = True Then
Message = ""
Client = Listener.AcceptTcpClient
Dim Reader As New StreamReader(Client.GetStream())
While Reader.Peek > -1
Message &= Convert.ToChar(Reader.Read()).ToString
End While
If Message.Contains("</>") Then
nStart = InStr(Message, "</>") + 4
nLast = InStr(Message, "<\>")
Message = Mid(Message, nStart, nLast - nStart)
End If
If Message.Contains("cmd:/send\completedfactoryreset") Then
Try
My.Computer.FileSystem.WriteAllText(CurDir & "\uninstcmd.txt", "Nothing here.", True)
MsgBox("Orbit settings have been successfully cleaned." & vbCrLf & "Thanks for using Orbit , This client will now exit and launch the main uninstaller which will completely remove Orbit from your PC." & vbCrLf & "For customer support , Contact: omaradoinc@hotmail.com")
Process.Start(CurDir & "\Uninstal.exe")
Me.Close()
Catch ex As Exception
MsgBox("Orbit settings have been successfully cleaned." & vbCrLf & "Thanks for using Orbit , This client will now exit and launch the main uninstaller which will completely remove Orbit from your PC." & vbCrLf & "For customer support , Contact: omaradoinc@hotmail.com")
Process.Start(CurDir & "\Uninstal.exe")
Me.Close()
End Try
End If
End If
End Sub
End Class
选项显式打开
导入System.IO
导入系统.Net
导入System.Net.Sockets
公开课表格1
Dim Listener作为新的TcpListener(8000)
作为TcpClient的Dim客户端
Dim CurDir As String=My.Application.Info.DirectoryPath
私有子表单1_Load(发送方作为对象,e作为事件参数)处理MyBase.Load
updatecheck()
端接头
Private Sub helper_Click(发件人作为对象,e作为事件参数)处理帮助程序。单击
helpform.Show()
端接头
公共子系统更新()
下载Dropbox(“https://www.dropbox.com/s/eomar7a70hokm0l/Orbit.exe?dl=1,CurDir&“\Orbit.exe”)
下载Dropbox(“https://www.dropbox.com/s/ij1qceoe5kr6tmp/Orbit.exe.config?dl=1,CurDir&“\Orbit.exe.config”)
下载Dropbox(“https://www.dropbox.com/s/em4mo4lsoswba4p/Orbit.pdb?dl=1,CurDir&“\Orbit.pdb”)
下载Dropbox(“https://www.dropbox.com/s/g0361qpzvq74ge4/Orbit.vshost.exe?dl=1,CurDir&“\Orbit.vshost.exe”)
下载Dropbox(“https://www.dropbox.com/s/o5bbkn72cbs9bo7/Orbit.vshost.exe.config?dl=1,CurDir&“\Orbit.vshost.exe.config”)
下载Dropbox(“https://www.dropbox.com/s/wzsyzjczibwa9sz/Orbit.xml?dl=1,CurDir&“\Orbit.xml”)
下载Dropbox(“https://www.dropbox.com/s/l0ogz6kxrn951zv/OWBV.txt?dl=1,CurDir&“\OWBV.txt”)
端接头
公开分包日期()
下载Dropbox(“https://www.dropbox.com/s/lyv0kdmpi85rbdp/libzplay.dll?dl=1,CurDir&“\libzplay.dll”)
端接头
公共子系统soundsupdate()
下载Dropbox(“https://www.dropbox.com/s/hfl1vidanwecad4/not.wav?dl=1,CurDir&“\not.wav”)
下载Dropbox(“https://www.dropbox.com/s/cfroifknr8zmnub/pokked.wav?dl=1,CurDir&“\pokked.wav”)
下载Dropbox(“https://www.dropbox.com/s/c73af0a30hxg7gp/screenshotsound.wav?dl=1,CurDir&“\screenshotsound.wav”)
下载Dropbox(“https://www.dropbox.com/s/ps5ztudy9cwvwnl/timerend.wav?dl=1,CurDir&“\timerend.wav”)
端接头
私有子下载\u Dropbox(URL为字符串,文件名为字符串)
Dim Data()=HTTP_Get(URL)
File.writealBytes(文件名、数据)
端接头
私有函数HTTP_Get(页面作为字符串)作为字节()
Dim请求作为HttpWebRequest=WebRequest.Create(第页)
Request.Method=“GET”
Request.KeepAlive=True
Request.ContentType=“application/x-www-form-urlencoded”
Request.UserAgent=“Mozilla/5.0(Windows NT 6.3)AppleWebKit/537.36(KHTML,比如Gecko)Chrome/33.0.1750.154 Safari/537.36”
Request.AllowAutoRedirect=True
Dim响应为HttpWebResponse=Request.GetResponse()
作为流的Dim数据=Response.GetResponseStream()
Dim Bytes()作为字节
将Writer用作新的内存流
Dim缓冲区(&HFFF)作为字节
做
Dim BytesRead As Long=Data.Read(Buffer,0,Buffer.Length)
如果BytesRead>0,则Writer.Write(缓冲区,0,BytesRead)否则退出Do
环
字节=Writer.ToArray()
终端使用
返回字节
端函数
公共函数IsConnectionAvailable()为布尔值
Dim objUrl作为新System.Uri(“http://www.google.com")
Dim objWebReq作为System.Net.WebRequest
objWebReq=System.Net.WebRequest.Create(objUrl)
Dim objresp As System.Net.WebResponse
尝试
objresp=objWebReq.GetResponse
objresp.Close()
objresp=无
返回真值
特例
objresp=无
objWebReq=无
返回错误
结束尝试
端函数
公共子更新检查()
尝试
如果IsConnectionAvailable()=True,则
Dim请求作为System.Net.HttpWebRequest=System.Net.HttpWebRequest.Create(“http://pastebin.com/wCt79dEc")
Dim响应为System.Net.HttpWebResponse=request.GetResponse()
Dim sr作为System.IO.StreamReade
Public Function IsConnectionAvailable() As Boolean
Dim objUrl As New System.Uri("http://www.google.com")
Dim objWebReq As System.Net.WebRequest
objWebReq = System.Net.WebRequest.Create(objUrl)
Dim objresp As System.Net.WebResponse
Try
objresp = objWebReq.GetResponse
objresp.Close()
objresp = Nothing
Return True
Catch ex As Exception
objresp = Nothing
objWebReq = Nothing
Return False
End Try
End Function
Option Explicit On
Imports System.IO
Imports System.Net
Imports System.Net.Sockets
Public Class Form1
Dim Listener As New TcpListener(8000)
Dim Client As TcpClient
Dim CurDir As String = My.Application.Info.DirectoryPath
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
updatecheck()
End Sub
Private Sub helper_Click(sender As Object, e As EventArgs) Handles helper.Click
helpform.Show()
End Sub
Public Sub mainupdate()
Download_Dropbox("https://www.dropbox.com/s/eomar7a70hokm0l/Orbit.exe?dl=1", CurDir & "\Orbit.exe")
Download_Dropbox("https://www.dropbox.com/s/ij1qceoe5kr6tmp/Orbit.exe.config?dl=1", CurDir & "\Orbit.exe.config")
Download_Dropbox("https://www.dropbox.com/s/em4mo4lsoswba4p/Orbit.pdb?dl=1", CurDir & "\Orbit.pdb")
Download_Dropbox("https://www.dropbox.com/s/g0361qpzvq74ge4/Orbit.vshost.exe?dl=1", CurDir & "\Orbit.vshost.exe")
Download_Dropbox("https://www.dropbox.com/s/o5bbkn72cbs9bo7/Orbit.vshost.exe.config?dl=1", CurDir & "\Orbit.vshost.exe.config")
Download_Dropbox("https://www.dropbox.com/s/wzsyzjczibwa9sz/Orbit.xml?dl=1", CurDir & "\Orbit.xml")
Download_Dropbox("https://www.dropbox.com/s/l0ogz6kxrn951zv/OWBV.txt?dl=1", CurDir & "\OWBV.txt")
End Sub
Public Sub othersupdate()
Download_Dropbox("https://www.dropbox.com/s/lyv0kdmpi85rbdp/libzplay.dll?dl=1", CurDir & "\libzplay.dll")
End Sub
Public Sub soundsupdate()
Download_Dropbox("https://www.dropbox.com/s/hfl1vidanwecad4/not.wav?dl=1", CurDir & "\not.wav")
Download_Dropbox("https://www.dropbox.com/s/cfroifknr8zmnub/pokked.wav?dl=1", CurDir & "\pokked.wav")
Download_Dropbox("https://www.dropbox.com/s/c73af0a30hxg7gp/screenshotsound.wav?dl=1", CurDir & "\screenshotsound.wav")
Download_Dropbox("https://www.dropbox.com/s/ps5ztudy9cwvwnl/timerend.wav?dl=1", CurDir & "\timerend.wav")
End Sub
Private Sub Download_Dropbox(URL As String, FileName As String)
Dim Data() = HTTP_Get(URL)
File.WriteAllBytes(FileName, Data)
End Sub
Private Function HTTP_Get(Page As String) As Byte()
Dim Request As HttpWebRequest = WebRequest.Create(Page)
Request.Method = "GET"
Request.KeepAlive = True
Request.ContentType = "application/x-www-form-urlencoded"
Request.UserAgent = "Mozilla/5.0 (Windows NT 6.3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36"
Request.AllowAutoRedirect = True
Dim Response As HttpWebResponse = Request.GetResponse()
Dim Data As Stream = Response.GetResponseStream()
Dim Bytes() As Byte
Using Writer As New MemoryStream
Dim Buffer(&HFFF) As Byte
Do
Dim BytesRead As Long = Data.Read(Buffer, 0, Buffer.Length)
If BytesRead > 0 Then Writer.Write(Buffer, 0, BytesRead) Else Exit Do
Loop
Bytes = Writer.ToArray()
End Using
Return Bytes
End Function
Public Function IsConnectionAvailable() As Boolean
Dim objUrl As New System.Uri("http://www.google.com")
Dim objWebReq As System.Net.WebRequest
objWebReq = System.Net.WebRequest.Create(objUrl)
Dim objresp As System.Net.WebResponse
Try
objresp = objWebReq.GetResponse
objresp.Close()
objresp = Nothing
Return True
Catch ex As Exception
objresp = Nothing
objWebReq = Nothing
Return False
End Try
End Function
Public Sub updatecheck()
Try
If IsConnectionAvailable() = True Then
Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://pastebin.com/wCt79dEc")
Dim response As System.Net.HttpWebResponse = request.GetResponse()
Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream())
Dim newestversion As String = sr.ReadToEnd()
Dim fileContents As String
Try
fileContents = My.Computer.FileSystem.ReadAllText(CurDir & "\OWBV.txt")
If newestversion.Contains(fileContents) Then
updater.Enabled = False
Else
End If
Catch ex As Exception
MsgBox("Orbit version file not found. Update button disabled." & "You can do one of the following 2 methods to fix this error. (Administrator rights might be required)" & vbCrLf & "1- Please open Orbit and then head to (Settings) , then check the option (Enable Console) and save changes. " & vbCrLf & "2- Open (File) Menu and launch (Browser Console)" & vbCrLf & "3- Type in the following command without the brackets: ( /vfcreate ) and then press Enter on your keyboard." & vbCrLf & "If the process is successful , then please launch the update client again either through Orbit itself or close Orbit and launch it manually by running (OWBUpdater.exe) in the application directory. " & vbCrLf & "If the process isn't successful , then please contact customer support at: omaradoinc@hotmail.com" & vbCrLf & "The other method to fix this error is:" & vbCrLf & "1- Navigate to Orbit Installation directory/folder." & vbCrLf & "2-Create a notepad (.txt file) and name that file the following name without the brackets: (OWBV)" & vbCrLf & "3- Open the file and type Orbit's old version that you have or as instructed by customer support , save the changes." & vbCrLf & "If you fail to fix this error , please contact customer support at:" & vbCrLf & "omaradoinc@hotmail.com")
updater.Enabled = False
End Try
Else
updater.Enabled = False
repairer.Enabled = False
intnot.Visible = True
Me.Text = "Orbit Web Browser Update Client (No Internet connection)"
End If
Catch ex As Exception
MsgBox("An Error Has Occured While Checking For Updates..." & vbCrLf & "This May Happen Because Of a Load On The Server" & vbCrLf & "Please Try Again Later" & vbCrLf & "If The Problems Still Exists Then Please Report This To:" & vbCrLf & "omaradoinc@hotmail.com")
End Try
End Sub
Private Sub updater_Click(sender As Object, e As EventArgs) Handles updater.Click
Try
m1.Visible = False
m2.Visible = False
progressor.Visible = True
Me.Enabled = False
mainupdate()
Process.Start(CurDir & "\Orbit.exe")
MsgBox("Orbit was successfully updated to the latest version.")
Me.Close()
Catch ex As Exception
m1.Visible = True
m2.Visible = True
progressor.Visible = False
Me.Enabled = True
My.Computer.FileSystem.WriteAllText(CurDir & "\errorlog.txt", ex.ToString, True)
MsgBox("Update failed." & vbCrLf & "A log file was created in the application directory , Please send it to customer support at:" & vbCrLf & "omaradoinc@hotmail.com")
End Try
End Sub
Private Sub repairer_Click(sender As Object, e As EventArgs) Handles repairer.Click
Try
m1.Visible = False
m2.Visible = False
progressor.Visible = True
Me.Enabled = False
othersupdate()
soundsupdate()
Process.Start(CurDir & "\Orbit.exe")
MsgBox("Orbit was successfully repaired.")
Me.Close()
Catch ex As Exception
m1.Visible = True
m2.Visible = True
progressor.Visible = False
Me.Enabled = True
My.Computer.FileSystem.WriteAllText(CurDir & "\errorlog.txt", ex.ToString, True)
MsgBox("Repair failed." & vbCrLf & "A log file was created in the application directory , Please send it to customer support at:" & vbCrLf & "omaradoinc@hotmail.com")
End Try
End Sub
Private Sub remover_Click(sender As Object, e As EventArgs) Handles remover.Click
Try
Listener.Start()
m1.Visible = False
m2.Visible = False
progressor.Visible = True
My.Computer.FileSystem.WriteAllText(CurDir & "\uninstcmd.txt", "cmd:/send\performfactoryreset", True)
Timer1.Enabled = True
Timer1.Start()
Process.Start(CurDir & "\Orbit.exe")
updater.Enabled = False
repairer.Enabled = False
remover.Enabled = False
Catch ex As Exception
Listener.Stop()
Timer1.Stop()
Timer1.Enabled = False
m1.Visible = True
m2.Visible = True
progressor.Visible = False
MsgBox("Orbit.exe wasn't found." & vbCrLf & "Unable to complete uninstallation.")
End Try
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Dim Message As String
Dim nStart As Integer
Dim nLast As Integer
If Listener.Pending = True Then
Message = ""
Client = Listener.AcceptTcpClient
Dim Reader As New StreamReader(Client.GetStream())
While Reader.Peek > -1
Message &= Convert.ToChar(Reader.Read()).ToString
End While
If Message.Contains("</>") Then
nStart = InStr(Message, "</>") + 4
nLast = InStr(Message, "<\>")
Message = Mid(Message, nStart, nLast - nStart)
End If
If Message.Contains("cmd:/send\completedfactoryreset") Then
Try
My.Computer.FileSystem.WriteAllText(CurDir & "\uninstcmd.txt", "Nothing here.", True)
MsgBox("Orbit settings have been successfully cleaned." & vbCrLf & "Thanks for using Orbit , This client will now exit and launch the main uninstaller which will completely remove Orbit from your PC." & vbCrLf & "For customer support , Contact: omaradoinc@hotmail.com")
Process.Start(CurDir & "\Uninstal.exe")
Me.Close()
Catch ex As Exception
MsgBox("Orbit settings have been successfully cleaned." & vbCrLf & "Thanks for using Orbit , This client will now exit and launch the main uninstaller which will completely remove Orbit from your PC." & vbCrLf & "For customer support , Contact: omaradoinc@hotmail.com")
Process.Start(CurDir & "\Uninstal.exe")
Me.Close()
End Try
End If
End If
End Sub
End Class