点晴ERP-还原图片路径函数
当前位置:点晴教程→知识管理交流
→『 技术文档交流 』
:点晴ERP-还原图片路径函数 在ASP文件上添加以下函数代码: '正则表达式匹配字符串函数 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 '获取图片实际的路径函数 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 调用函数即可 Y_images=rs("Y_images") Y_images=decryption_imgpath(Y_images) 该文章在 2023/7/6 16:18:06 编辑过 |
关键字查询
相关文章
正在查询... |