生成一个加密的e-mail 地址

 

 1    private   string  CmsCloakText( string  text)
 2          {
 3              StringBuilder sb  =   new  StringBuilder();
 4              System.Text.ASCIIEncoding asciiEncoding  =   new  ASCIIEncoding();
 5               byte [] bytes  =   new   byte [text.Length];
 6               int  count  =  asciiEncoding.GetBytes(text,  0 , text.Length, bytes,  0 );
 7               for  ( int  i  =   0 ; i  <  count; i ++ )
 8              {
 9                  sb.Append(( int )bytes[i]);
10                   if  (i  <  count  -   1 )
11                  {
12                      sb.Append( " , " );
13                  }
14              }
15               return  sb.ToString();
16          }
17           private   string  GetEmail( string  strEmail, string  ShowMessage)
18          {
19              StringBuilder sb  =   new  StringBuilder();
20              
21              sb.Append( " <script> " );
22              sb.Append( " document.write(\ " < class   =   ' CmsPageBottomFeedback '  href = ' mailto:\" + String.fromCharCode(" + this.CmsCloakText(strEmail) + ")+\" ' > \ " ); " );
23 
24              sb.Append( " document.write(String.fromCharCode( "   +   this .CmsCloakText(ShowMessage)  +   " )); " );
25              sb.Append( " document.write('</a>'); " );
26              sb.Append( " </script> " );
27               return  sb.ToString();
28 
29               //            <script>
30               // document.write("<a href='mailto:" + String.fromCharCode(105,105,121,106,114,113,119,64,49,54,51,46,99,111,109) +"'>");
31               // document.write(String.fromCharCode(105,105,121,106,114,113,119,64,49,54,51,46,99,111,109));
32               // document.write('</a>');
33               // </script>
34 
35          }

你可能感兴趣的:(mail)