我有以下代碼,從而產生插入查詢格式化的字符串
For Each f As String In Directory.GetFiles(d)
objSQLStringBuilder.Append("insert into table1 (full_path, file_name) values ('" & f.Replace("'", "''") & "', '" & f.Remove(0, Len(d) + 1).Replace("'", "''") & "');")
Next
然而,它找到的路徑我需要如下
格式化路徑格式如下c:\program files\microsoft office\winword.exe
file:///c:/program%20files/microosoft%20office/winword.exe
我該如何修改上面的代碼來做到這一點?
它從來不是一個好主意,「生成插入查詢」,特別是使用用戶輸入 – 2011-01-07 16:27:18