如何连接到WebService [英] How to connect to WebService

查看:208
本文介绍了如何连接到WebService的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 8 - Metro Style(C#)下遇到以下对象和定义的问题/错误。如何 我可以
重写这个吗?

I have a Problem/Error with the following Objects and definitions under Windows 8 - Metro Style (C#). How can I rewrite this?

HttpWebRequest request =(HttpWebRequest)WebRequest.Create(uri);
$
StringReader reader = new StringReader(responseText);



请求。 {ServerPoint} .Expection100Continue = false;
$
request.Headers。{Add}(" abc",hostUser);
$
Stream requestStream = request。{GetRequestStream()} ;
$
{FileStream} attachment = new {FileStream}(path,{FileMode} .open);
$
WebResponse response = request。{GetResponse()};

{XmlDocument} result = new {XmlDocument()};

result。{Load}(读者);

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
StringReader reader = new StringReader(responseText);

request.{ServerPoint}.Expection100Continue = false;
request.Headers.{Add}("abc", hostUser);
Stream requestStream = request.{GetRequestStream()};
{FileStream} attachment = new {FileStream}(path, {FileMode}.open);
WebResponse response = request.{GetResponse()};
{XmlDocument} result = new {XmlDocument()};
result.{Load}(reader);

 

区域
in { } 将不被接受
以红色显示。谢谢你

The areas that are enclosed in { } will not be accepted and displayed in red. Thanks

 



推荐答案

您需要重写此项以使用Metro风格配置文件,异步请求和缓冲区而不是同步文件API。 

HttpClient上传示例
和// build / session
使应用社交并与HTTP服务相关联
应该有助于您入门。 

You will need to rewrite this to use the Metro style profile, async requests, and buffers instead of synchronous file API.  The HttpClient Upload Sample and the //build/ session Making apps social and connected with HTTP services should help get you started. 

- Rob

 

 

 


这篇关于如何连接到WebService的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆