點晴ERP-還原圖片路徑函數(shù)
當(dāng)前位置:點晴教程→知識管理交流
→『 技術(shù)文檔交流 』
:點晴ERP-還原圖片路徑函數(shù) 在ASP文件上添加以下函數(shù)代碼: '正則表達(dá)式匹配字符串函數(shù) Function regx(patrn, str) Dim regEx, Match, Matches Set regEx = New RegExp regEx.Pattern = patrn regEx.IgnoreCase = True regEx.Global = True Set Matches = regEx.execute(str) For Each Match in Matches RetStr = RetStr & Match.Value & " " Next regx = RetStr End Function '獲取圖片實際的路徑函數(shù) Function decryption_imgpath (Y_images_path) if isNull(Y_images_path) then else if Instr(Y_images_path,"read.ashx")>0 then Y_images_path=regx("img.*?uploadlog_code",Y_images_path) Y_images_path=regx("c=2.*?uploadlog_code",Y_images_path) Y_images_path=replace(Y_images_path,"c=","") Y_images_path=replace(Y_images_path,"uploadlog_code","") Y_images_path=replace(Y_images_path," ","") Y_images_path=replace(Y_images_path,"&","") Y_images_path=replace(Y_images_path,"amp;","") set rs_all=server.createobject("adodb.recordset") sql_all="select * from mis_uploader_fileinf where visitcode like" & sqlstr("%"&Y_images_path&"%") 'response.write sql_all rs_all.Open sql_all,conn,3,1 if rs_all.recordcount>0 then file_physical_path=rs_all("file_physical_path") file_physical_path=replace(file_physical_path,"C:\ClickSun","",1,-1,1) file_physical_path=replace(file_physical_path,"D:\ClickSun","",1,-1,1) file_physical_path=replace(file_physical_path,"E:\ClickSun","",1,-1,1) file_physical_path=replace(file_physical_path,"F:\ClickSun","",1,-1,1) file_physical_path=replace(file_physical_path,"G:\ClickSun","",1,-1,1) file_physical_path=replace(file_physical_path,"H:\ClickSun","",1,-1,1) file_physical_path=replace(file_physical_path,"I:\ClickSun","",1,-1,1) file_physical_path=replace(file_physical_path,"J:\ClickSun","",1,-1,1) file_physical_path=replace(file_physical_path,"K:\ClickSun","",1,-1,1) file_physical_path=replace(file_physical_path,"\","/") img_html="<img src='"&file_physical_path&"' style=""width:100%;"">" Y_images_path=img_html end if rs_all.close end if end if decryption_imgpath=Y_images_path End Function 調(diào)用函數(shù)即可 Y_images=rs("Y_images") Y_images=decryption_imgpath(Y_images) 該文章在 2023/7/6 16:18:06 編輯過 |
關(guān)鍵字查詢
相關(guān)文章
正在查詢... |