C# to PHP base64 encode/decode_PHP_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > PHP > C# to PHP base64 encode/decode

C# to PHP base64 encode/decode

 2015/4/1 2:16:53  kenkao  程序员俱乐部  我要评论(0)
  • 摘要:http://stackoverflow.com/questions/257462/c-sharp-to-php-base64-encode-decodeWeshouldprobablyURLEncodeyourBase64stringontheC#sidebeforeyousendit.AndURLDecodeitonthephpsidepriortobase64decodingit.C#sidebyte[]encbuff=System.Text.Encoding.UTF8.GetBytes
  • 标签:C# PHP ASE

http://stackoverflow.com/questions/257462/c-sharp-to-php-base64-encode-decode

We?should probably URL Encode your Base64 string on the C# side before you send it.

And URL Decode it on the php side prior to base64 decoding it.

C# side

byte[] encbuff = System.Text.Encoding.UTF8.GetBytes("the string");
string enc = Convert.ToBase64String(encbuff);
string urlenc = Server.UrlEncode(enc);

and php side:

$data = $_REQUEST['in'];
$decdata = urldecode($data);
$raw = base64_decode($decdata);
上一篇: 消息称22年老牌财经杂志《环球企业家》将清算 下一篇: 没有下一篇了!
发表评论
用户名: 匿名