Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 应用程序更新程序代码返回,但未找到404_Vb.net_.htaccess_Httpwebrequest - Fatal编程技术网

Vb.net 应用程序更新程序代码返回,但未找到404

Vb.net 应用程序更新程序代码返回,但未找到404,vb.net,.htaccess,httpwebrequest,Vb.net,.htaccess,Httpwebrequest,因为我正在制作一个程序,所以我想给它添加一个应用程序更新程序。我在这里搜索(通常我在这里找到其他主题的答案),但这一个没有返回,就像我的问题一样D 我正在使用以下代码: Private Sub worker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles worker1.DoWork Try Dim request As System

因为我正在制作一个程序,所以我想给它添加一个应用程序更新程序。我在这里搜索(通常我在这里找到其他主题的答案),但这一个没有返回,就像我的问题一样D

我正在使用以下代码:

Private Sub worker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles worker1.DoWork
   Try
      Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://nighthawk1037.comze.com/apps/gmailbomber/currentversion.txt")
      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 currentversion As String = Application.ProductVersion

      If newestversion.Contains(currentversion) Then
         MessageBox.Show("You have the current version", "Update Check")
      Else
         MessageBox.Show("A Newer version is available! Gmail Email Bomber will attempt to download and run the new update!", "Update Check")
         My.Computer.Network.DownloadFile(New Uri("http://nighthawk1037.comze.com/apps/gmailbomber/update/gmail_email_bomberv1-beta2.exe"), "C:\Program Files\gmailbomber\gmail_email_bomberv1-beta2.exe", "", "", True, 60000, True, FileIO.UICancelOption.DoNothing)
         Process.Start("C:\Program Files\gmailbomber\gmail_email_bomberv1-beta2.exe")
         Me.Close()
      End If

    Catch ex As Exception
      MessageBox.Show(ex.Message)
    End Try
End Sub
要让我的VB.Net程序检查我的网站上的currentversion.txt,如果是新版本,它将下载最新版本。通常,当我脱机尝试时(wamp服务器) 但是由于某种原因,
ex.message
返回一个
远程服务器返回一个错误:(404未找到)。
消息。这当然意味着目录/文件不在远程服务器上。但我已经确认了大约10次,所有的东西都在我的网站上,链接都是正确的,所有的东西都应该正常工作,但出于某种原因,我得到了那个错误。 是因为文件权限吗


注意:我在
nighthawk1037.comze.com/apps
上有一个
.htaccess
,它重定向到同一目录下的
index.php
文件,并重定向到主页,但我删除了它,仍然得到了错误,现在我的
.htaccess
唯一的功能就是
IndexIgnore
,这样人们就无法检查文件了。

知道是什么原因吗?请记住,当作为标准用户运行(或启用UAC)时,程序文件文件夹是只读的。下载到临时文件夹。如果您认为问题可能出在.htaccess文件上,请将其删除并再次检查。或者尝试将文件放在其他目录中,看看是否有效。它会将文件下载到程序安装在c:\program files\gmail Bomber\gmail\u email\u bomberv0.2.exe和nope中的位置,删除.htaccess无效:/非常聪明!检查这个:->这是应用程序目录,完全为空,但当我用ftp上传它时,目录内容就在那里。。以下是ftp的屏幕: