以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  求助 照片加密  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=68233)

--  作者:telek
--  发布时间:2015/5/12 22:57:00
--  求助 照片加密

求助 照片加密

 图片点击可在新窗口打开查看 ElseIf e.DataCol.Name = "第二学历证件" Then
        Dim dr As DataRow = e.DataRow
        If dr.IsNull("工作单位") Then
            MessageBox.Show("工作单位不能为空!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            e.Cancel = True
        ElseIf Dr.IsNull("姓名") Then
            MessageBox.Show("姓名不能为空!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            e.Cancel = True
        ElseIf Dr.IsNull("乡镇名称")   Then
            MessageBox.Show("乡镇名称不能为空!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            e.Cancel = True
        ElseIf Dr.IsNull("证件号码")   Then
            MessageBox.Show("身份证号码不能为空!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            e.Cancel = True
        ElseIf Dr.IsNull("工作单位")   Then
            MessageBox.Show("工作单位不能为空!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
            e.Cancel = True
        Else
            e.SubFolder = "证件" & "\\" & dr("乡镇名称") & "\\" & dr("工作单位") & "\\" & "第二学历"
            e.FileName = dr("证件号码") & ".jpg"
        End If

EncryptFile("c:\\temp\\Logo.jpg", "c:\\temp\\Logo2.jpg", "fox123")
DecryptFile(
"c:\\temp\\Logo2.jpg", "c:\\temp\\Logo3.jpg", "fox123"
)

加密函数 或解密函数子么写的


--  作者:telek
--  发布时间:2015/5/12 23:01:00
--  
Dim dd As String = ProjectPath & "Attachments" & "\\" & "证件" & "\\" & dr("乡镇名称") & "\\" & dr("工作单位") & "\\" & "第一学历" & "\\" & e.FileName 
EncryptFile(e.SourceFolder & "\\" & e.FileName,dd,"fox123")
            dr("第一学历证件")=fl
这样写的对吗?

--  作者:大红袍
--  发布时间:2015/5/12 23:08:00
--  
e.SubFolder =  "证件" & "\\" & dr("乡镇名称") & "\\" & dr("工作单位") & "\\" & "第二学历"
e.FileName = dr("证件号码") & ".jpg"
EncryptFile(ProjectPath & "Attachments/" & e.SubFolder & "/" & e.FileName, ProjectPath & "Attachments/" & e.SubFolder & "/" & dr("证件号码") & "_加密.jpg", "fox123")

--  作者:telek
--  发布时间:2015/5/12 23:34:00
--  
谢谢你在帮CurrentChanged 事件解密代码好吗?
--  作者:Bin
--  发布时间:2015/5/13 8:42:00
--  
http://www.foxtable.com/help/topics/1346.htm


--  作者:大红袍
--  发布时间:2015/5/13 9:20:00
--  

又加密,又解密,有什么意义?

 

Dim dr As Row = e.Table.Current
If dr IsNot Nothing Then
    Dim SubFolder As String =  "证件" & "\\" & dr("乡镇名称") & "\\" & dr("工作单位") & "\\" & "第二学历"
    Dim FileName As String = dr("证件号码") & ".jpg"
    If FileSys.FileExists(ProjectPath & "Attachments/" & SubFolder & "/" & dr("证件号码") & "_加密.jpg") Then
        DecryptFile(ProjectPath & "Attachments/" & SubFolder & "/" & dr("证件号码") & "_加密.jpg", ProjectPath & "Attachments/" & SubFolder & "/" & FileName, "fox123")
    End If
End If


--  作者:telek
--  发布时间:2015/5/14 1:37:00
--  
谢谢