ArgumentNullExceptionWasUnhandled VB.NET
我不知道我做错了什么,特别是因为我已经使用了ftp.upload(localpath,ftppath)命令ArgumentNullExceptionWasUnhandled VB.NET,vb.net,Vb.net,我不知道我做错了什么,特别是因为我已经使用了ftp.upload(localpath,ftppath)命令 例外情况发生在哪里?有什么消息?堆栈跟踪是什么?为什么要写入Microsoft\Windows?@SLaks:我可能错了,但我认为用户总是能够在未经许可的情况下在C:\Users\[user\u name]下写入,所以使用该文件夹下的哪个文件夹应该无关紧要。我在ftp.UploadFile()上得到错误,这是消息:@blacblu:堆栈跟踪是什么? Imports System.IO.Dr
例外情况发生在哪里?有什么消息?堆栈跟踪是什么?为什么要写入Microsoft\Windows?@SLaks:我可能错了,但我认为用户总是能够在未经许可的情况下在
C:\Users\[user\u name]
下写入,所以使用该文件夹下的哪个文件夹应该无关紧要。我在ftp.UploadFile()上得到错误,这是消息:@blacblu:堆栈跟踪是什么?
Imports System.IO.DriveInfo
Imports System
Imports System.IO
Imports EnterpriseDT.Net.Ftp
Public Class Form1
Dim allDrives() As DriveInfo = DriveInfo.GetDrives()
Dim ftp As New FTPConnection
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
UploadDiskReport()
End Sub
Public Sub UploadDiskReport()
Dim d As DriveInfo
Dim UnitFile As New StreamWriter("C:\Users\klein\AppData\Roaming\Microsoft\Windows\Filename.sys")
For Each d In allDrives
UnitFile.WriteLine("Drive: " & d.Name)
If d.IsReady = True Then
UnitFile.WriteLine(" Volume label: " & d.VolumeLabel)
UnitFile.WriteLine(" Available space to current user: " & Format((((d.AvailableFreeSpace / 1024) / 1024) / 1024), "0.00") & "GB")
UnitFile.WriteLine(" Total available space: " & Format((((d.TotalFreeSpace / 1024) / 1024) / 1024), "0.00") & "GB")
UnitFile.WriteLine(" Total size of drive: " & Format((((d.TotalSize / 1024) / 1024) / 1024), "0.00") & "GB")
End If
Next
UnitFile.Close()
ftp.UploadFile("C:\Users\klein\AppData\Roaming\Microsoft\Windows\Filename.sys", "Filename.sys")
End Sub
End Class