你根本就没有给Vars("ip2")赋值
If e.DataCol.Name = "产品效果图" Then
If e.NewValue <> Nothing Then
Dim file As String = ProjectPath & "Attachments\" & e.NewValue
If FileSys.FileExists(file) Then
Dim img As image = getImage(file)
Dim bmp As new bitmap(getImage(file), img.width / 5, img.height / 5)
'file = "D:\文件检索图\" & e.NewValue
file = "D:\文件检索图\" & e.NewValue
Dim path As String = file.Replace(FileSys.GetName(file),"")
If FileSys.DirectoryExists(path) = False Then '如果目录C:\MyFolder存在
FileSys.CreateDirectory(path)
End If
bmp.save(file)
bmp.Dispose
End If
e.DataRow("缩略图") = e.NewValue
End If
End If