Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/14.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找不到目录_Vb.net_Directory_Find - Fatal编程技术网

VB.net找不到目录

VB.net找不到目录,vb.net,directory,find,Vb.net,Directory,Find,这是完整的代码。 我有一个问题,在下载mod之后,所有的工作都很好,RAR文件位于document文件夹中,而extranted内容(@mod)位于Documents文件夹下的launcherma下 从第184行开始,单击按钮安装mod时,我发现以下错误: Private Sub FlatButton6_Click(sender As Object, e As EventArgs) Handles FlatButton6.Click If My.Computer.FileSystem.D

这是完整的代码。

我有一个问题,在下载mod之后,所有的工作都很好,RAR文件位于document文件夹中,而extranted内容(@mod)位于Documents文件夹下的launcherma下

从第184行开始,单击按钮安装mod时,我发现以下错误:

Private Sub FlatButton6_Click(sender As Object, e As EventArgs) Handles FlatButton6.Click
   If My.Computer.FileSystem.DirectoryExists(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "\LauncherArma") Then
        My.Computer.FileSystem.DeleteDirectory(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "\LauncherArma", FileIO.DeleteDirectoryOption.DeleteAllContents)
    End If


    If My.Computer.FileSystem.FileExists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\LauncherArma\modsname.txt") Then
        My.Computer.FileSystem.DeleteFile(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\LauncherArma\modsname.txt")
    End If

    My.Computer.FileSystem.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "\LauncherArma")
    UnRar(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "\Addon.rar", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "\LauncherArma")
    Dim ligne As String
    My.Computer.Network.DownloadFile("FTP ADDRESS. Hidden for security. Don't worry, the download files works!/modsname.txt", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\LauncherArma\modsname.txt")
    Dim sr As New StreamReader(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\LauncherArma\modsname.txt")
    While sr.Peek <> -1
        ligne = sr.ReadLine()
        My.Computer.FileSystem.CopyDirectory(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "\LauncherArma\" & ligne, directory & "\" & ligne, True)
    End While
    PictureBox1.Visible = True
    FlatButton6.Visible = False
    FlatProgressBar1.Visible = False
    FlatLabel1.Visible = False
    FlatLabel2.Visible = False
    FlatLabel3.Visible = False
End Sub

Private子平面按钮6\u单击(发送者作为对象,e作为事件参数)处理平面按钮6。单击
如果存在My.Computer.FileSystem.directory(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)和“\LauncherArma”),则
My.Computer.FileSystem.DeleteDirectory(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)和“\LauncherArma”,FileIO.DeleteDirectoryOption.DeleteAllContents)
如果结束
如果存在My.Computer.FileSystem.files(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)和“\launcherma\modsname.txt”),则
My.Computer.FileSystem.DeleteFile(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)和“\launcherma\modsname.txt”)
如果结束
My.Computer.FileSystem.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)和“\LauncherArma”)
UNRR(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)和“\Addon.rar”,Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)和“\LauncherArma”)
像线一样变暗
My.Computer.Network.DownloadFile(“FTP地址.为安全起见隐藏.别担心,下载文件可以工作!/modsname.txt”,Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)和“\launcherma\modsname.txt”)
Dim sr作为新的StreamReader(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)和“\launcherma\modsname.txt”)
而老皮克-1
ligne=sr.ReadLine()
My.Computer.FileSystem.CopyDirectory(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)和“\LauncherArma\”和ligne,目录和“\”和ligne,True)
结束时
PictureBox1.Visible=True
FlatButton6.可见=错误
FlatProgressBar1.Visible=False
FlatLabel1.Visible=False
FlatLabel2.Visible=False
FlatLabel3.可见=假
端接头
我不知道如何解决这个问题

等待你的答复


关于

能否在此处添加相关代码?没有人会读那堵代码墙。触发错误的按钮单击中的代码应为enough@Steve从第170行到第184行,CopyDirectory方法的异常原因之间唯一引发此异常的原因是:源目录不存在,因此,或者您没有权限,或者目录源不存在。我会根据源目录的结构逐行检查FTP下载的文件的内容所有文件都存在。FTP使用防弹的权限设置为“仅读取文件”和“目录为列表”的权限。在fast中,当文件下载时,正如我在下面所说的,RAR位于主文档文件夹中,而压缩文件位于文档文件夹下的ArmaLauncher中…=问题已解决!必须从APPData中删除该文件夹!