Using system; using system. io; using system. collections; using system. data; using system. LINQ; using system. web; using system. web. services; using system. web. services. protocols; using system. XML. LINQ; using system. net; using system. text; namespace webapplication1 {[WebService (namespace = "http://tempuri.org/")] [webservicebinding (conformsto = wsiprofiles. basicprofile1_1)] public class handler1: ihttphandler {public void processrequest (httpcontext context) {httpwebrequest Req = (httpwebrequest) httpwebrequest. create ("http://fanyi.baidu.com/transcontent"); encoding = encoding. utf8; string Param = "Ie = UTF-8 & source = TXT & query = Hello & t = 1327829764203 & token = 8a7dcbacb3ed72cad9f3fb079809a127 & from = Auto & to = auto"; // encoding. getbytes (postdata); byte [] BS = encoding. ASCII. getbytes (PARAM); string responsedata = string. empty; req. method = "Post"; req. contenttype = "application/X-WWW-form-urlencoded"; req. contentlength = BS. length; using (Stream reqstream = req. getrequeststream () {reqstream. write (BS, 0, BS. length); reqstream. close ();} using (httpwebresponse response = (httpwebresponse) req. getresponse () {using (streamreader reader = new streamreader (response. getresponsestream (), encoding) {responsedata = reader. readtoend (). tostring ();} context. response. write (responsedata) ;}} public bool isreusable {get {return false ;}}}}