原句如下: For Each key As String In e.Files.Keys
If key = "img01" Then
For Each fln As String In e.Files(key)
Dim NewName As String = fln '为防止上传同名文件而定义一个新文件名称
Dim idx As Integer=fln.LastIndexOf(".")
Dim cnt As Integer = 1
Do Wh ile FileSys.File Exists(".\Photo\" & NewName) '判断文件夹是否存在同名文件
NewName = fln.Ins ert(idx,primaryKey & "_" & cnt) '如果碰到有同名文件上传,就在文件名称后面自动+记录行号 + 1
cnt = cnt + 1
Loop
e.SaveFile(key,fln,".\Photo\" & NewName) '以新的文件名保存到的文件夹,
Next
dr.Lines("img01")=e.Files(key) ’但保存在字段名中的文件名还是原来的文件名,
End If
Next
dr.Save()
问题如上红色文字说明,
请教:
应该如何修改,才能实现保存在字段 dr("img01") 中的文件名称串也是新的文件名字。
谢谢!