-1

ファイルを解凍しようとすると例外が発生します

try を削除すると、次のように表示されます。

追加情報: オブジェクト参照がオブジェクトのインスタンスに設定されていません。

    Try
        Dim sc As New Shell32.Shell()
        '
        'Create directory in which you will unzip your files .
        '
        IO.Directory.CreateDirectory(Application.StartupPath & "/Packs/SkyNet/mods")
        '
        'Declare the folder where the files will be extracted
        '
        Dim output As Shell32.Folder = sc.NameSpace(Application.StartupPath & "/Packs/SkyNet/mods")
        '
        'Declare your input zip file as folder  .
        '
        Dim input As Shell32.Folder = sc.NameSpace(Application.StartupPath & "/Downloads/SkyNet.zip")
        '
        'Extract the files from the zip file using the CopyHere command .
        '
        output.CopyHere(input.Items, 4)
        My.Computer.FileSystem.WriteAllText(Application.StartupPath & "/Config/SkyNet.pack", "SkyNet Installed", False)
    Catch ex As Exception
        MessageBox.Show("Could Not Extract Pack: SkyNet", "SkyNet Launcher: Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        My.Computer.FileSystem.WriteAllText(Application.StartupPath & "/Config/SkyNet.pack", "SkyNet Not Installed", False)
    End Try

output.CopyHere(input.Items, 4)output.CopyHere(input.Items, 148)に設定しようとしましたが、同じエラーが返されます。

(148 は zip 内のアイテムの数です)

4

1 に答える 1

0

入力または出力フォルダーのパスが無効な場合、このエラーが発生します。dim ステートメントでパスを使用する前に、パスを確認してください。

于 2015-02-15T19:08:52.373 に答える