| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3117 人关注过本帖
标题:小学生求指教,谢谢各位大神帮忙看看
只看楼主 加入收藏
pisces零
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2015-12-15
收藏
 问题点数:0 回复次数:1 
小学生求指教,谢谢各位大神帮忙看看
怎么在点击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
搜索更多相关主题的帖子: 数据库 Object 小学生 源文件 
2015-12-16 11:43
pisces零
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2015-12-15
收藏
得分:0 
在线等,
2015-12-16 11:45
快速回复:小学生求指教,谢谢各位大神帮忙看看
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017519 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved