Pages

星期三, 12月 23, 2009

GeoCoding HttpWebRequest

string url = "http://geowebgaej.appspot.com/webService/GeoCoding";
string data = "TestAccount
{0}
";
string postData = string.Format(data, TextBox1.Text);



HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url);
myHttpWebRequest.AllowWriteStreamBuffering = false;
myHttpWebRequest.Method = "POST";
UTF8Encoding encjavascript:void(0)odedData = new UTF8Encoding();
byte[] byteArray = encodedData.GetBytes(postData);
myHttpWebRequest.ContentType = "application/x-www-form-urlencoded";
myHttpWebRequest.ContentLength = byteArray.Length;
Stream newStream = myHttpWebRequest.GetRequestStream();
newStream.Write(byteArray, 0, byteArray.Length);
newStream.Close();
HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
StreamReader sr = new StreamReader(myHttpWebResponse.GetResponseStream(), System.Text.Encoding.UTF8);
TextBox2.Text = sr.ReadToEnd();
sr.Close();

星期三, 7月 01, 2009

Virtual PC 安裝 Ubuntu 9 server

使用Virtual PC 2007 安裝 Ubuntu 時,一開始就出現問題 [end trace 4eaa2a86a8e2da22],
解決的方式如下(我安裝的是Ubuntu server 9.04 版本):
在設定畫面下按F6,然後直接按下Esc,這時游標會直接focus在畫面下方的設定參數上,將"
quiet splash --"字串刪除,並輸入"vga=791 noreplace-paravirt"替代,按下Enter鍵開始安裝。

原始參考資料:Installing Ubuntu 9.04 on Microsoft Virtual PC 2007 SP1