以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  下面这段代码 想改为 在原来文件名前面加上sm字段应该怎么改?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=64631)

--  作者:jinzhengbe
--  发布时间:2015/2/26 1:30:00
--  下面这段代码 想改为 在原来文件名前面加上sm字段应该怎么改?
    Dim prestr As String = e.Form.Controls("TextBox名称前缀").Text
    Dim s As New String("0", cnt)
    For Each fl In dlg.FileNames
        Dim i As Integer = 0
        For Each file As String In FileSys.GetFiles(e.Form.Controls("DropBox文件保存文件夹").Text)
          \'  If e.Form.Controls("RadioButton按前缀和类型编序号").Checked Then
           \'     If file.SubString(file.LastIndexOf("\\") + 1,prestr.Length) = prestr AndAlso IsNumeric(file.SubString(file.LastIndexOf("\\") + 1 + prestr.Length)) AndAlso file.SubString(file.LastIndexOf(".")) = fl.SubString(fl.LastIndexOf(".")) Then
        \'            i + = 1
      \'          End If
     \'             End If
      Next
        i + = 1
        If e.Form.Controls("CheckBox图片缩放").Checked Then
            Dim width As Integer = e.Form.Controls("NumericComboBox宽").Value
            Dim height As Integer = e.Form.Controls("NumericComboBox高").Value
            Dim img As Image = GetImage(fl)
            Dim bmp As Bitmap
            If e.Form.Controls("CheckBox保持比例").Checked Then
                \'Dim bmp As New Bitmap(GetImage(fl),width,Width/img.width*img.Height)
                bmp = New Bitmap(GetImage(fl),width,Width/img.width*img.Height)
            Else
                \'Dim bmp As New Bitmap(GetImage(fl),width,height)
                bmp = New Bitmap(GetImage(fl),width,height)
            End If
            bmp.Save(e.Form.Controls("DropBox文件保存文件夹").Text & "\\" & prestr & Format(i,s) & fl.SubString(fl.LastIndexOf(".")))
        Else
            FileSys.CopyFile(fl,e.Form.Controls("DropBox文件保存文件夹").Text & "\\" & prestr & Format(i,s) & fl.SubString(fl.LastIndexOf(".")))
        End If
    Next
    SaveConfigValue("默认来源文件夹",fl.SubString(0,fl.LastIndexOf("\\")))
    SaveConfigValue("默认保存文件夹",e.Form.Controls("DropBox文件保存文件夹").Text)
End If

--  作者:Bin
--  发布时间:2015/2/26 9:15:00
--  
bmp.Save(e.Form.Controls("DropBox文件保存文件夹").Text & "\\sm" & prestr & Format(i,s) & fl.SubString(fl.LastIndexOf(".")))
--  作者:有点甜
--  发布时间:2015/2/26 9:19:00
--  

 不明白你的意思,sm字段?你的代码是循环所有的文件,而不是循环所有的表数据,跟表没有任何关系


--  作者:Bin
--  发布时间:2015/2/26 9:20:00
--  
bmp.Save(e.Form.Controls("DropBox文件保存文件夹").Text & "\\" & tables("XX").current("sm") & prestr & Format(i,s) & fl.SubString(fl.LastIndexOf(".")))

[此贴子已经被作者于2015/2/26 9:20:14编辑过]