Foxtable(狐表)用户栏目专家坐堂 → 文件命名规则


  共有3222人关注过本帖树形打印复制链接

主题:文件命名规则

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/10/21 9:56:00 [显示全部帖子]

Dim dr As DataRow = e.DataRow
If dr.IsNull("产品名称")  Then
    MessageBox.Show("请先输入身份证号码!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    e.Cancel = True
Else
    Dim ss As String = e.filename
    Dim Index As Integer = ss.LastIndexOf(".")
    Dim hz As String = ss.SubString(Index,ss.length-Index)
    ss = dr("产品名称")
    e.filename = ss & hz
    If e.DataRow(e.DataCol.name).Contains(ss) Then
        Dim max As Integer = 0
        For Each s As String In e.DataRow.Lines(e.DataCol.name)
            If s Like "*" & ss & "*" Then
                Dim fni1 As Integer=s.LastIndexOf("-")
                If fni1 > -1 Then
                    Dim fni2 As Integer = s.LastIndexOf(".")
                    fni1 = s.SubString(fni1+1, fni2 - fni1 - 1)
                    If fni1 > max Then
                        max = fni1
                    End If
                End If
            End If
        Next
        e.filename = ss & "-" & (max+1) & hz
    End If
End If

 回到顶部