1
有誰知道如何解析一個Webclient.DowloadFile到VB.Net文件? 我目前使用下面的代碼,但我不斷收到錯誤: (BC30491)表達式不會產生一個值。類型的 (BC30311)值不能被轉換到文件WebClient.DownloadFile轉換爲文件VB.NET
Private Function DepartmentDataDownloader() As String
Dim webClient As New System.Net.WebClient
'I get here the error BC30491
Dim result As File = webClient.DownloadFile("https://intern.hethoutsemeer.nl/index2.php?option=com_webservices&controller=csv&method=hours.board.fetch&key=F2mKaXYGzbjMA4V&element=departments", "intern.hethoutsemeer.nl.1505213278-Departments.csv")
If webClient IsNot Nothing Then
'and here BC30311
Dim result As File = webClient
UploaderFromDownload(webClient)
End If
Return ""
End Function
的FUNC ['DownloadFile'](https://msdn.microsoft.com/en-us/library/ez801hhe(V = vs.110)的.aspx)將不會返回值。你可以用你存儲下載文件的路徑初始化'File' – Prisoner