string strTurkish ="ÜST";
如何使strTurkish的价值成为"UST"?
以下值fhr_1计算为0.0为什么fhr_1不是0.3?
double fhr_1;
int n_fhr_1 = 9;
int n_fhr_0 = 15;
int n_fhr_2 = 6;
fhr_1 = n_fhr_1/(n_fhr_1 + n_fhr_0 + n_fhr_2);
Run Code Online (Sandbox Code Playgroud) 我想从远程服务器读取xml文件,但不知何故服务器没有响应我的请求.因此,Gzip抛出"GZip标头中的幻数不正确"异常.任何的想法?
private static string GetFile()
{
Uri uri = new Uri(@"http://www.iddaa.com.tr/XML/IDDAAMACPROGRAMI/index.htm?iddaadrawid=12.09.2012&iddaadrawide=13.09.2012&foraccess=KSsec654");
string xmlFile;
HttpWebRequest req = (HttpWebRequest) HttpWebRequest.Create(uri);
req.UserAgent =
"MOZILLA/5.0 (WINDOWS NT 6.1; WOW64) APPLEWEBKIT/537.1 (KHTML, LIKE GECKO) CHROME/21.0.1180.75 SAFARI/537.1";
req.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
req.Headers.Add("Accept-Encoding", "gzip,deflate");
using (GZipStream zip = new GZipStream(req.GetResponse().GetResponseStream(),
CompressionMode.Decompress))
{
var reader = new StreamReader(zip);
xmlFile = reader.ReadToEnd();
}
return xmlFile;
}
Run Code Online (Sandbox Code Playgroud)