小学生求指教,谢谢各位大神帮忙看看
怎么在点击save操作后将上传的源文件文件名和文件路径保存到数据库 Protected Sub Button_FileUpload1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim IntlsUF As Integer
IntlsUF = 1
IF file.HasFile=true THen
Dim strFileTName As String
strFileTName=file.PostedFile.FileName
Try
file.SaveAs(Server.MapPath("~/legacy/TEST/test/") + strFileTName)
Catch ex As Exception
Label1.Text = IntlsUF.ToString
End Try
if IntlsUF = 1 then
Label1.Text = "文件上传成功"
Label1.Text += "<Br/>"
Label1.Text += "<li>" + "原文件路径:" + strFileTName
Else
Label1.Text = "文件上传失败" + IntlsUF.ToString
End If
End If
End Sub
Protected Sub Button_Save_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Me.Button_Save.Enabled = False
If Me.TextBox_Insert_Customer.Text <> "" Then
Me.TextBox_Insert_Customer.Text = Me.TextBox_Insert_Customer.Text.Trim
Me.TextBox_Insert_Customer.Text = Me.TextBox_Insert_Customer.Text.ToUpper
End If
If Me.TextBox_Insert_RPTID.Text <> "" Then
Me.TextBox_Insert_RPTID.Text = Me.TextBox_Insert_RPTID.Text.Trim
Me.TextBox_Insert_RPTID.Text = Me.TextBox_Insert_RPTID.Text.ToUpper
End If
Try
Me.sdDaily_Manage.Insert()
Me.gvDaily_Mange.DataBind()
Catch ex As Exception
'MsgBox(ex.Message)
Me.ClientScript.RegisterStartupScript(Me.GetType(), "Startup", BuildWarning(ex.Message))
'Response.Write ( ex.Message)
'Response.End
End Try
Me.TextBox_Insert_Customer.Text = ""
Me.TextBox_Insert_RPTID.Text = ""
Me.TextBox_Insert_Description.Text = ""
Me.Button_Save.Enabled = True
End Sub