本文介绍了在vb.net中解密电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 大约一年前,我开始向我的公司开发一个程序,从我们的网站上提取客户电话,解密并将其推送到我们的内部软件,然后再发送到支持部门。 这里的问题:在上周,我的基本假设是我们的服务器做了一些自动更新,它导致(按目的?)html页面的解密变化。我为什么这么说?在代码中,我正在寻找标签,如从开始。我现在得到的文字就是这样的。我需要知道我得到的加密类型是什么以及如何解密它。拜托,这非常紧急!!! 补充说:经过研究,我发现微软在我们的服务器上做了5次安全更新。当我比较我在安全更新之前和之后收到的电子邮件时,我发现旧电子邮件中包含以下内容: Content-Transfer-Encoding:8bit 和新电子邮件包含: Content-Transfer-Encoding:base64。 i认为这是我的问题的根源。现在我需要知道如何将base64解密回原始编码。 这里是旧解密函数的一部分: Sub GetEmails(ByVal Server_Command As String ) Dim m_buffer()As Byte = System。 Text.Encoding.UTF8.GetBytes(Server_Command.ToCharArray()) Dim stream_Reader As StreamReader Dim TxtLine As String = 尝试 ' x = x& ,10 m_sslStream.Write(m_buffer,0,m_buffer.Length)' x = x& ,11 stream_Reader = New StreamReader(m_sslStream,Encoding.UTF8) do while stream_Reader.Peek()<> -1 TxtLine + = stream_Reader.ReadLine()& vbNewLine 循环 System.IO.File.WriteAllText( directory / utf8.html,TxtLine) Dim einfo As New EmailInfo TextBox1.Text = 调用Utilities.GetEmailInfo(TxtLine) Dim AdpX作为新的OleDbDataAdapter,tbl作为新的DataTable,行作为DataRow,sql As String sql = SELECT * FROM TempCalls AdpX = GetAdapter(sql, \ Service.mdb) AdpX.Fill(tbl) row = tbl.NewRow row( 许可证)= Val(GetFldSc( [מס 'לקוח],TxtLine))行( LicName) = GetFldSc( [שםהעסק],TxtLine) row( IDNumber)= GetFldSc( [ח.פ/ע.מ],TxtLine) End Sub 这是函数提取文本: 公共函数GetFldSc(fldToSearch As String , msgStr As String )As String Dim str As String = Dim index As Integer = msgStr.IndexOf( < tbody>) Dim objRegEx As System.Text.RegularExpressions.Regex ' msgStr = objRegEx.Replace(msgStr,,)'替换所有 string : msgStr.ToString.Replace( , ) msgStr = msgStr.Substring(index,( msgStr.Length - index)) Dim bodyArray()As String = Split(msgStr,vbCrLf) For i = 0 到bodyArray.Length - 1 如果bodyArray(i).IndexOf(fldToSearch)<> -1然后 str = bodyArray(i - 1 )。子字符串( 14 ,(( bodyArray(i - 1 )。长度 - 5 ) - 14 )) str.Replace( , ) str = objRegEx.Replace(str, , )退出结束如果下一个如果str = < span> N / A< / span>或str = < span> N / A< / span>然后str = 返回str 结束功能 这是我得到的新解码和我不知道如何处理它: + OK消息跟随 MIME-Version:1.0 收到:10.28.39.193 with HTTP;星期一,2015年4月20日23:31:55 -0700(PDT) In-Reply-To:< [email protected]> 参考文献:< [email protected]> 日期:星期二,2015年4月21日09:31:55 +0300 Delivered-To:############ 消息ID:< cada2pvozucpnd3ykhoqotueuj> 主题:=?UTF-8?B?RndkOiBb157Xmdeg15nXodeV16TXmCDXqtee15nXm9eUIC0gW9ek16rXmdeX16og16fXqA ==?= =?UTF-8?B?15nXkNeU?= 来自:oron sultan To:## ####### 内容类型:multipart / alternative; boundary = 001a11468f00e604be0514363370 --001a11468f00e604be0514363370 Content-Type:text / plain;字符集= UTF-8 含量传输编码:BASE64 15TXldeT16LXlCDXqdeU15XXoteR16jXlA0K157XkNeqOiBb157Xmdeg15nXodeV16TXmCDXqtee 15nXm9eUIC0gW9ek16rXmdeX16og16fXqNeZ15DXlCA8ZXJlemdvbGFuMDFAZ21haWwuY29tPg0K 16rXkNeo15nXmjogMyDXkdee16jXpSAyMDE1INeR16nXoteUIDE0OjMxDQrXoNeV16nXkDogW9ee 15nXoNeZ16HXldek15gg16rXnteZ15vXlCAtIFvXpNeq15nXl9eqINen16jXmdeQ15QNCteQ15w6 IOKAq21pbmlzb2Z0MzY1QGdtYWlsLmNvbeKArA0KDQoNCg0KICAgICAq16TXqNeY15kg15fXkdeo 15QqICAgMzcyMzg1IFvXntehJyDXnNen15XXl10gICDXnteV16DXmdeV16og16TXqteQ15wgW9ep 150g15TXoteh16ddICAgNTEzNjA3NzYyDQpb15cu16Qv16Iu155dICAg157Xldeg15nXldeqIFvX odeZ15XXldeSINeU16LXodenXSAgIDMuMDkzMiBb157XoScg15LXqNeh15RdICAwNTMtNzY5MTMw NiBb15jXnNek15XXnw0K16jXkNep15ldICAgaW5iYWwubWVnYUBnbWFpbC5jb20gW9eQ15nXnteZ 15nXnCDXqNeQ16nXmV0gICAgKtek16jXmNeZINeU16HXoNeZ16MqICAg15DXmdec16ogW9ep150N $ b $ b CteU16HXoNeZ16NdICAg157XkteV16jXmQ0K15zXkSDXpNeq15DXnCBb15vXqteV15HXql0gICDX kNeZ15zXqiBb15nXqdeV15FdICAgMDgtNj MzODAwMiBb15jXnNek15XXnyDXkdeh16DXmdejXSAg IDA3Ny05MzM4MDAyIFvXpNen16FdDQogICrXpNeo15jXmSDXkNeZ16kg15TXp9ep16gqICAg16LX oNeR15wgW9ep150g15DXmdepINeU16fXqdeoXSAgINee16DXlNecINeX16nXkdeV16DXldeqIFvX qtek16fXmdeTXQ0KMDUzLTc2OTEzMDYgW9eY15zXpNeV158NCteQ15nXqSDXp9ep16hdICBOL0Eg IFvXqdec15XXl9eUXSAgIGluYmFsLm1lZ2FAZ21haWwuY29tIFvXkNeZ157XmdeZ15wg15DXmdep INen16nXqF0NCg0KKtek16jXmNeZINen16jXmdeQ15QqDQogICA4NTYgW9eg15XXqdeQINep15nX qNeV16pdICAg15TXldeX15bXqCDXp9eV15HXpSDXqdeS15XXmSDXkNeg15kg16bXqNeZ15vXlCDX kNeqINeU16fXldeR16Ug16nXnCDXnteS15Ag157Xodeq15nXmdedINeRDQo2NjYyMSBb16TXqNeY 15kg16fXqNeZ15DXlF0NCg == --001a11468f00e604be0514363370 Content-Type:text / html;字符集= UTF-8 含量传输编码:BASE64 PGRpdiBkaXI9InJ0bCI + PGJyPjxkaXYgY2xhc3M9ImdtYWlsX3F1b3RlIj7XlNeV15PXoteUINep 15TXldei15HXqNeUPGJyPtee15DXqjogPGIgY2xhc3M9ImdtYWlsX3NlbmRlcm5hbWUiPlvXnteZ 16DXmdeh15XXpNeYINeq157Xmdeb15QgLSBb16TXqteZ15fXqiDXp9eo15nXkNeUPC9iPiA8c3Bh biBkaXI9Imx0ciI + Jmx0OzxhIGhyZWY9Im1haWx0bzplcmV6Z29sYW4wMUBnbWFpbC5jb20iPmVy ZXpnb2xhbjAxQGdtYWlsLmNvbTwvYT4mZ3Q7PC9zcGFuPjxicj7XqteQ16jXmdeaOiAzINeR157X qNelIDIwMTUg15HXqdei15QgMTQ6MzE8YnI + 16DXldep15A6IFvXnteZ16DXmdeh15XXpNeYINeq 157Xmdeb15QgLSBb16TXqteZ15fXqiDXp9eo15nXkNeUPGJyPteQ15w6ICDigKs8YSBocmVmPSJt YWlsdG86bWluaXNvZnQzNjVAZ21haWwuY29tIj5taW5pc29mdDM2NUBnbWFpbC5jb208L2E + 4OCS PGJyPjxicj48YnI + PHA + wqA8L3A + DQo8dGFibGUgc3R5bGU9ImZsb2F0OnJpZ2h0IiBib3JkZXI9 IjEiIGFsaWduPSJyaWdodCI + PGNhcHRpb24 + wqA8L2NhcHRpb24 + DQo8dGJvZHk + DQo8dHI + DQo8 DGQ + wqA8L3RkPg0KPHRkIGRpcj0icnRsIj48c3BhbiBzdHlsZT0idGV4dC1kZWNvcmF0aW9uOnVu ZGVybGluZSI + PHN0cm9uZz7XpNeo15jXmS DXl9eR16jXlDwvc3Ryb25nPjwvc3Bhbj48L3RkPg0K PC90cj4NCjx0cj4NCjx0ZCBkaXI9InJ0bCI + wqAzNzIzODU8L3RkPg0KPHRkIGRpcj0icnRsIj5b 157XoSYjMzk7INec16fXldeXXTwvdGQ + DQo8L3RyPg0KPHRyPg0KPHRkIGRpcj0icnRsIj7CoNee 15XXoNeZ15XXqiDXpNeq15DXnDwvdGQ + DQo8dGQgZGlyPSJydGwiPlvXqdedINeU16LXodenXTwv DGQ + DQo8L3R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yZ2V0PSJfYmxhbmsiPmluYmFsLm1lZ2FAZ21haWwuY29tPC9hPjwvdGQ + DQo8dGQgZGlyPSJydGwiPlvXkNeZ157XmdeZ15wg15DXmdepINen16nXqF08L3RkPg0KPC90cj4N Cjx0cj4NCjx0ZD7CoDwvdGQ + DQo8dGQ + DQo8cCBkaXI9InJ0bCI + PHN0cm9uZz48c3BhbiBzdHls ZT0idGV4dC1kZWNvcmF0aW9uOnVuZGVybGluZSI + 16TXqNeY15kg16fXqNeZ15DXlDwvc3Bhbj48 L3N0cm9uZz48L3A + DQo8L3RkPg0KPC90cj4NCjx0cj4NCjx0ZCBkaXI9InJ0bCI + wqA4NTY8L3Rk Pg0KPHRkIGRpcj0icnRsIj5b16DXldep15Ag16nXmdeo15XXql08L3RkPg0KPC90cj4NCjx0cj4N Cjx0ZCBkaXI9InJ0bCI + wqDXlNeV15fXlteoINen15XXkdelINep15LXldeZINeQ16DXmSDXpteo 15nXm9eUINeQ16og15TXp9eV15HXpSDXqdecINee15LXkCDXnteh16rXmdeZ150g15EgNjY2MjE8 L3RkPg0KPHRkIGRpcj0icnRsIj5b16TXqNeY15kg16fXqNeZ15DXlF08L3RkPg0KPC90cj4NCjwv dGJvZHk + DQo8L3RhYmxlPg0KDQo8L2Rpdj48YnI + PC9kaXY + DQo = --001a11468f00e604be0514363370-- 将。/ cada2pvozucpnd3ykhoqotueuj>< ; / tbody> 解决方案 您认为电子邮件是加密的是什么?几乎不。如果这是base64,它与加密无关。 这就是你如何使用它: https://msdn.microsoft.com/en-us/library/system.convert.frombase64string% 28v = vs.110%29.aspx [ ^ ], 请参阅其他base64方法: https://msdn.microsoft.com/en-us/library/System.Convert_methods%28v=vs.110%29.aspx [ ^ ]。 如果你需要解析整个电子邮件,可能需要做更多的工作。我建议看一下 open-source OpenPOP.NET: http:// hpop。 sourceforge.net [ ^ ], http://sourceforge.net/projects/hpop [ ^ ]。 不,您不必使用其POP3客户端实现或完全使用该产品。 这个产品写得不是很完美,但我把它作为一个信息来源使用了很多。涉及太多标准(RFC),尤其是MIME,因此很难挖掘出您需要的所有内容。 OpenPOP一丝不苟地使用和参考所有这些标准。 片段你'你的评论中显示的内容如下: < p> < / p为H. < table style =float:right; border =1align =right>< caption> < /字幕> < tbody> < tr> < td> < / TD> < td dir =rtl>< span style =text-decoration:underline;>< strong>פ׬×〜×™× - ×'ר×< ; / strong>< / span>< / td> < / tr> < tr> < td dir =rtl> 1< / td> < td dir =rtl> [×ž×¡×œ×§×•× - ]< / td> < / tr> < tr> ; < td dir =rtl>×ו×שיווקו×'×יו< / td> < ; td dir =rtl> [ש×??×עסק]< / td> < / tr> < tr> < td dir =rtl> 1·; / TD> < td dir =rtl> [× - 。פ/×¢。מ]< / td> < / tr> < tr> < td dir =rtl> ר××××××××××××××××/×td < td dir =rtl> [סיוו×'×עסק]< / td> < / tr> < tr> < td dir =rtl> 3.232< / td> < td dir =rtl> [מס'×'ר ס×]< / TD> < / tr> < tr> < td dir =rtl> 05555555555< / td> < td dir =rtl> [×〜לפוןר×??ש×TM]< / td> < / tr> < tr> < td dir =rtl> [email protected]< / TD> < td dir =rtl> [×××××××××××××××××××××××××××]× < / tr> < tr> < td> < / TD> < td dir =rtl>< strong>< span style =text-decoration:underline;>פר×〜×™×ס××™×£ < / span>< / strong>< / td> < / tr> < tr> < td dir =rtl>×'×™ תשמש< / td> < td dir =rtl> [ש×??×ס××™×£]< / td> < / tr> < tr> < td dir =rtl> ×× - ר××'×™×?? 333< / td> < td dir =rtl> [×>תו×'ת]< / td> ; < / tr> < tr> < td dir =rtl>×'יתשמש< / td> < td dir =rtl> [ישו×']< / td> < / tr> < tr> < ; td dir =rtl> 055000000< / td> < td dir =rtl> [×〜לפון×'ס××™×£ ; / td> < / tr> < tr> < td dir =rtl> 5555555555555< / td> < td dir = rtl> [פקס]< / td> < / tr> < tr> < td>< / td> < td dir =rtl>< strong>< span style =text-decoration:underline;>פר×〜×™×??יש××§× ©×¨< /跨度>< /强>< / TD> < / tr> < tr> < td dir =rtl> ×??ורו×Y< / TD> < td dir =rtl> [ש×?? ×??יש×קשר]< / td> < / tr> < tr> < td dir =rtl >מ××>ל< / td> < td dir =rtl> [תפקי×]< / td> < / tr> < tr> < td dir =rtl> 0505000000< / td> < td dir =rtl> [×〜לפון×??×™×©× §×©×¨]< / td> < / tr> < tr> < td dir =rtl> 1< / td> < td dir =rtl> [של×× - ×]< / td> < / tr> < tr> < td dir =rtl> [email protected]< / TD> < td dir =rtl> [×??ימייל×??ישקשר]< / td> < / tr> < tr> < td> < / TD> < td> < p dir =rtl>< strong>< span style =text-decoration:underline;>פר×〜יקרי×?? ×< / span>< / strong>< / p> < / td> < / tr> < tr> < td dir =rtl>פקו×ותיומן< / td> < td dir =rtl> [×וש×?? שירות] LT; / TD> < / tr> < tr> < td dir =rtl> DC< / TD> < td dir =rtl> [פר×〜יקרי×??×]< / td> < / tr> < / tbody> < / table> 请自己做这件事,这是基本练习我给了你所需要的一切。 但获得的HTML文件因为这个电子邮件部分不会被正确渲染。你还需要指定UTF-8编码。你总是需要把它夹在 html , head 和 body 元素: <? xml version = 1.0 encoding = UTF-8 ?> < html > < head > < title > 某些titme& lt; / title> < meta http-equiv = Content-Type content = text / html; charset = utf-8 / > < / head > < body > <! - 您的内容 - > < / body > < / html > -SA hey guys,about a year ago i developed a program to my comapny that extract customers call from our website, decrypt it and pushed it to our internel software and from ther to the support department.here the problem: during the last week, my basic assumption is that our server did some automatic updates and it cause (by purpose?) changes in the decription of html pages. why am i saying this? in the code, i'm looking for tags such as to start from. the text that i get now is nothing like this. i need to know what is the encryption type that i get and how can i decrypt it. please, this is very urgent!!!added: after research, i found out that microsoft made 5 security updates in our server. when i compare the emails i get before and after the security updates, i found out that the old email contain this: Content-Transfer-Encoding: 8bitand the new emails contains this:Content-Transfer-Encoding: base64.i think this is the source of my problem. now i need to know how to decrypy base64 back to the original encoding.here is a section of the function of the old decryption:Sub GetEmails(ByVal Server_Command As String) Dim m_buffer() As Byte = System.Text.Encoding.UTF8.GetBytes(Server_Command.ToCharArray()) Dim stream_Reader As StreamReader Dim TxtLine As String = "" Try 'x = x & ",10" m_sslStream.Write(m_buffer, 0, m_buffer.Length) 'x = x & ",11" stream_Reader = New StreamReader(m_sslStream, Encoding.UTF8) Do While stream_Reader.Peek() <> -1 TxtLine += stream_Reader.ReadLine() & vbNewLine Loop System.IO.File.WriteAllText("directory/utf8.html", TxtLine) Dim einfo As New EmailInfo TextBox1.Text = "" Call Utilities.GetEmailInfo(TxtLine) Dim AdpX As New OleDbDataAdapter, tbl As New DataTable, row As DataRow,sql As String sql = "SELECT * FROM TempCalls" AdpX = GetAdapter(sql, "\Service.mdb") AdpX.Fill(tbl) row = tbl.NewRow row("License") = Val(GetFldSc("[מס' לקוח]", TxtLine)) row("LicName") = GetFldSc("[שם העסק]", TxtLine) row("IDNumber") = GetFldSc("[ח.פ/ע.מ]", TxtLine) End Suband this is the function which extract the text: Public Function GetFldSc(fldToSearch As String, msgStr As String) As String Dim str As String = "" Dim index As Integer = msgStr.IndexOf("<tbody>") Dim objRegEx As System.Text.RegularExpressions.Regex 'msgStr = objRegEx.Replace(msgStr, " ", "") 'Replace all " " in the string with: "" msgStr.ToString.Replace(" ", "") msgStr = msgStr.Substring(index, (msgStr.Length - index)) Dim bodyArray() As String = Split(msgStr, vbCrLf) For i = 0 To bodyArray.Length - 1 If bodyArray(i).IndexOf(fldToSearch) <> -1 Then str = bodyArray(i - 1).Substring(14, ((bodyArray(i - 1).Length - 5) - 14)) str.Replace(" ", "") str = objRegEx.Replace(str, " ", "") Exit For End If Next If str = "<span>N/A</span>" Or str = " <span>N/A</span>" Then str = "" Return str End Functionthis is the new decoding that i get and i dont know how to handle it:+OK message followsMIME-Version: 1.0Received: by 10.28.39.193 with HTTP; Mon, 20 Apr 2015 23:31:55 -0700 (PDT)In-Reply-To: <[email protected]>References: <[email protected]>Date: Tue, 21 Apr 2015 09:31:55 +0300Delivered-To: ############Message-ID: <cada2pvozucpnd3ykhoqotueuj>Subject: =?UTF-8?B?RndkOiBb157Xmdeg15nXodeV16TXmCDXqtee15nXm9eUIC0gW9ek16rXmdeX16og16fXqA==?==?UTF-8?B?15nXkNeU?=From: oron sultan To: #########Content-Type: multipart/alternative; boundary=001a11468f00e604be0514363370--001a11468f00e604be0514363370Content-Type: text/plain; charset=UTF-8Content-Transfer-Encoding: base6415TXldeT16LXlCDXqdeU15XXoteR16jXlA0K157XkNeqOiBb157Xmdeg15nXodeV16TXmCDXqtee15nXm9eUIC0gW9ek16rXmdeX16og16fXqNeZ15DXlCA8ZXJlemdvbGFuMDFAZ21haWwuY29tPg0K16rXkNeo15nXmjogMyDXkdee16jXpSAyMDE1INeR16nXoteUIDE0OjMxDQrXoNeV16nXkDogW9ee15nXoNeZ16HXldek15gg16rXnteZ15vXlCAtIFvXpNeq15nXl9eqINen16jXmdeQ15QNCteQ15w6IOKAq21pbmlzb2Z0MzY1QGdtYWlsLmNvbeKArA0KDQoNCg0KICAgICAq16TXqNeY15kg15fXkdeo15QqICAgMzcyMzg1IFvXntehJyDXnNen15XXl10gICDXnteV16DXmdeV16og16TXqteQ15wgW9ep150g15TXoteh16ddICAgNTEzNjA3NzYyDQpb15cu16Qv16Iu155dICAg157Xldeg15nXldeqIFvXodeZ15XXldeSINeU16LXodenXSAgIDMuMDkzMiBb157XoScg15LXqNeh15RdICAwNTMtNzY5MTMwNiBb15jXnNek15XXnw0K16jXkNep15ldICAgaW5iYWwubWVnYUBnbWFpbC5jb20gW9eQ15nXnteZ15nXnCDXqNeQ16nXmV0gICAgKtek16jXmNeZINeU16HXoNeZ16MqICAg15DXmdec16ogW9ep150NCteU16HXoNeZ16NdICAg157XkteV16jXmQ0K15zXkSDXpNeq15DXnCBb15vXqteV15HXql0gICDXkNeZ15zXqiBb15nXqdeV15FdICAgMDgtNjMzODAwMiBb15jXnNek15XXnyDXkdeh16DXmdejXSAgIDA3Ny05MzM4MDAyIFvXpNen16FdDQogICrXpNeo15jXmSDXkNeZ16kg15TXp9ep16gqICAg16LXoNeR15wgW9ep150g15DXmdepINeU16fXqdeoXSAgINee16DXlNecINeX16nXkdeV16DXldeqIFvXqtek16fXmdeTXQ0KMDUzLTc2OTEzMDYgW9eY15zXpNeV158NCteQ15nXqSDXp9ep16hdICBOL0EgIFvXqdec15XXl9eUXSAgIGluYmFsLm1lZ2FAZ21haWwuY29tIFvXkNeZ157XmdeZ15wg15DXmdepINen16nXqF0NCg0KKtek16jXmNeZINen16jXmdeQ15QqDQogICA4NTYgW9eg15XXqdeQINep15nXqNeV16pdICAg15TXldeX15bXqCDXp9eV15HXpSDXqdeS15XXmSDXkNeg15kg16bXqNeZ15vXlCDXkNeqINeU16fXldeR16Ug16nXnCDXnteS15Ag157Xodeq15nXmdedINeRDQo2NjYyMSBb16TXqNeY15kg16fXqNeZ15DXlF0NCg==--001a11468f00e604be0514363370Content-Type: text/html; charset=UTF-8Content-Transfer-Encoding: base64PGRpdiBkaXI9InJ0bCI+PGJyPjxkaXYgY2xhc3M9ImdtYWlsX3F1b3RlIj7XlNeV15PXoteUINep15TXldei15HXqNeUPGJyPtee15DXqjogPGIgY2xhc3M9ImdtYWlsX3NlbmRlcm5hbWUiPlvXnteZ16DXmdeh15XXpNeYINeq157Xmdeb15QgLSBb16TXqteZ15fXqiDXp9eo15nXkNeUPC9iPiA8c3BhbiBkaXI9Imx0ciI+Jmx0OzxhIGhyZWY9Im1haWx0bzplcmV6Z29sYW4wMUBnbWFpbC5jb20iPmVyZXpnb2xhbjAxQGdtYWlsLmNvbTwvYT4mZ3Q7PC9zcGFuPjxicj7XqteQ16jXmdeaOiAzINeR157XqNelIDIwMTUg15HXqdei15QgMTQ6MzE8YnI+16DXldep15A6IFvXnteZ16DXmdeh15XXpNeYINeq157Xmdeb15QgLSBb16TXqteZ15fXqiDXp9eo15nXkNeUPGJyPteQ15w6ICDigKs8YSBocmVmPSJtYWlsdG86bWluaXNvZnQzNjVAZ21haWwuY29tIj5taW5pc29mdDM2NUBnbWFpbC5jb208L2E+4o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rXmdeZ150g15EgNjY2MjE8L3RkPg0KPHRkIGRpcj0icnRsIj5b16TXqNeY15kg16fXqNeZ15DXlF08L3RkPg0KPC90cj4NCjwvdGJvZHk+DQo8L3RhYmxlPg0KDQo8L2Rpdj48YnI+PC9kaXY+DQo=--001a11468f00e604be0514363370--.</cada2pvozucpnd3ykhoqotueuj></tbody> 解决方案 What make you thinking that the e-mail is encrypted? Hardly. If this is base64, it has nothing to do with "encryption".This is how you can work with it: https://msdn.microsoft.com/en-us/library/system.convert.frombase64string%28v=vs.110%29.aspx[^],see other base64 methods: https://msdn.microsoft.com/en-us/library/System.Convert_methods%28v=vs.110%29.aspx[^].If you need to parse the whole e-mail, it may take a lot more work. I would advice to look at open-source OpenPOP.NET:http://hpop.sourceforge.net[^],http://sourceforge.net/projects/hpop[^].No, you don't have to use its POP3 client implementation or use the product at all.This product is not perfectly written, but I used it a lot as a source of information. There are too many standards (RFC) involved, especially MIME, so it would be hard to dig out everything you need. OpenPOP meticulously uses and reference all those standards.[EDIT #1]The fragment you've shown in your comment reads:<p> </p><table style="float: right;" border="1" align="right"><caption> </caption><tbody><tr><td> </td><td dir="rtl"><span style="text-decoration: underline;"><strong>פרטי חבר×"</strong></span></td></tr><tr><td dir="rtl"> 1</td><td dir="rtl">[מס' לקוח]</td></tr><tr><td dir="rtl"> ×"ו×" שיווק ×•×‘× ×™×•</td><td dir="rtl">[×©× ×"עסק]</td></tr><tr><td dir="rtl"> 1</td><td dir="rtl">[×—.פ/×¢.מ]</td></tr><tr><td dir="rtl"> רו××™ חשבון</td><td dir="rtl">[סיווג ×"עסק]</td></tr><tr><td dir="rtl"> 3.232</td><td dir="rtl">[מס' גרס×"]</td></tr><tr><td dir="rtl">05555555555</td><td dir="rtl">[טלפון ר×שי]</td></tr><tr><td dir="rtl"> [email protected]</td><td dir="rtl">[×ימייל ר×שי]</td></tr><tr><td> </td><td dir="rtl"><strong><span style="text-decoration: underline;">פרטי ×"×¡× ×™×£</span></strong></td></tr><tr><td dir="rtl"> בית שמש</td><td dir="rtl">[×©× ×"×¡× ×™×£]</td></tr><tr><td dir="rtl"> ×"×—×¨×•×‘×™× 333</td><td dir="rtl">[כתובת]</td></tr><tr><td dir="rtl"> בית שמש</td><td dir="rtl">[ישוב]</td></tr><tr><td dir="rtl"> 055000000</td><td dir="rtl">[טלפון ×‘×¡× ×™×£]</td></tr><tr><td dir="rtl"> 5555555555555</td><td dir="rtl">[פקס]</td></tr><tr><td> </td><td dir="rtl"><strong><span style="text-decoration: underline;">פרטי ×יש ×"קשר</span></strong></td></tr><tr><td dir="rtl"> ×ורון</td><td dir="rtl">[×©× ×יש ×"קשר]</td></tr><tr><td dir="rtl"> ×ž× ×›"ל</td><td dir="rtl">[תפקי×"]</td></tr><tr><td dir="rtl"> 0505000000</td><td dir="rtl">[טלפון ×יש קשר]</td></tr><tr><td dir="rtl">1 </td><td dir="rtl">[שלוח×"]</td></tr><tr><td dir="rtl"> [email protected]</td><td dir="rtl">[×ימייל ×יש קשר]</td></tr><tr><td> </td><td><p dir="rtl"><strong><span style="text-decoration: underline;">פרטי קרי××"</span></strong></p></td></tr><tr><td dir="rtl"> פקו×"ות יומן</td><td dir="rtl">[× ×•×©× ×©×™×¨×•×ª]</td></tr><tr><td dir="rtl"> dc</td><td dir="rtl">[פרטי קרי××"]</td></tr></tbody></table>Please do such thing yourself, this is elementary exercises. I gave you all you need.[EDIT #2]But the HTML file obtained as this e-mail part won't be rendered correct as it is. You also need to specify UTF-8 encoding. You always need to sandwich it in html, head and body elements:<?xml version="1.0" encoding="UTF-8"?><html> <head> <title>some titme</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head><body><!-- your content here --></body></html>—SA 这篇关于在vb.net中解密电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-18 17:42