C# ';%';无法接受字符串形式的php代码

C# ';%';无法接受字符串形式的php代码,c#,php,C#,Php,我正在使用C#和.php文件从服务器上读写一个.txt文件,在我的C# 到 我得到了错误 “错!(400个错误请求)' 由于字符串中的%而从服务器上删除,我的字符串中不能包含此项吗?坦克。只能使用ASCII字符集通过互联网发送URL。 由于URL通常包含ASCII集之外的字符,因此必须将URL转换为有效的ASCII格式 string mycontent = WebUtility.UrlEncode("42.00% £3.80 sending test string"); UrlEncode方法

我正在使用C#和.php文件从服务器上读写一个.txt文件,在我的C#

我得到了错误

“错!(400个错误请求)'


由于字符串中的%而从服务器上删除,我的字符串中不能包含此项吗?坦克。

只能使用ASCII字符集通过互联网发送URL。 由于URL通常包含ASCII集之外的字符,因此必须将URL转换为有效的ASCII格式

string mycontent = WebUtility.UrlEncode("42.00% £3.80 sending test string");

UrlEncode方法用于接收字符串,并将不安全的ASCII字符替换为“%”后跟两个十六进制数字。

%
在URL中有特殊含义。

<。。。。所以urlencode itAs我正在使用Unity3D WWW.EscapeURL()发送字符串,使用WWW.UnEscapeURL()接收字符串,谢谢。
<?php
$txtcontent = $_REQUEST['txt'];
$fp = fopen("file.txt", w);
fwrite($fp, $txtcontent);
echo $fp;
fclose($fp);
?>
string mycontent = "42.00 £3.80 sending test string";
string mycontent = "42.00% £3.80 sending test string";
string mycontent = WebUtility.UrlEncode("42.00% £3.80 sending test string");