无法上传文件缺少System.Web.UI.WebControls.FileUpload

时间:2013-12-18 20:36:06

标签: asp.net vb.net visual-studio-2010 file-upload

我有一个Web应用程序,我试图让用户能够上传文件,但是当我测试程序时,这是我得到的错误消息;

Could not find file 'C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\10.0\System.Web.UI.WebControls.FileUpload'.

我认为这是Visual Studio 2010中包含的内容吗?

这是一个代码示例;

    Dim txtFile As String

    firstName = FirstNameTextBox.Text
    lastName = LastNameTextBox.Text
    empID = EmpIDTextBox.Text
    newStore = StoreDropDownList.SelectedValue
    newDate = DateTextBox.Text
    altDate = Replace(newDate, "/", "_")
    URL = "https://URL.com/date.pdf"
    txtFile = PDFFileUpload.ToString

    Dim userName As String
    Dim passWord As String
    Dim tempURL As String

    userName = "?????"
    passWord = "?????"
    tempURL = "https://url.com

    My.Computer.Network.UploadFile(txtFile, tempURL, userName, passWord, True, 500)

1 个答案:

答案 0 :(得分:0)

检查

txtFile = PDFFileUpload.ToString()

如果你有正确的,我相信它可以找到该文件。