返回首页

我创建了一个WCF服务库项目使用wsHttpBinding的和成功运行的服务

"http://.......:8731/Design_Time_Addresses/ServiceWSHttp/Service1/mex"

WCF客户端代码:

添加WCFservice在客户端(Windows应用程序)应用程序中使用"添加服务引用",并创建一个按钮,它的代理

private void button1_Click(object sender, EventArgs e)

        {

            ServiceReference1.Service1Client s = new WinFormWSHttp.ServiceReference1.Service1Client() ;

            MessageBox.Show(s.GetData(3).ToString());

 

        }

它的成功运行在同一个系统,当我自主机WCF服务,并运行一个客户端。但不是我的WCF客户端是在不同的系统运行时,它抛出一个异常

{C}什么problm我的代码,请帮我

回答

评论会员:游客 时间:2012/02/06
|CPallini:有很多教程左右。见,例如imgsrc=]
。arunrv
评论会员:游客 时间:2012/02/06
U可以使用名称空间使用System.IO然后使用此代码codeprelang="c#"spanclass="code-comment"///spanspanclass="code-comment"Thiscodeisusedtowritedatainto.txtfile.../spanFileStreamfs=spanclass="code-keyword"new/spanFileStream(spanclass="code-string""/spanspanclass="code-string"E:\\a.txt"/span,FileMode.Create,FileAccess.Write);StreamWriterwrite=spanclass="code-keyword"new/spanStreamWriter(fs);spanclass="code-keyword"string/spana_variable=spanclass="code-string""/spanspanclass="code-string"moreadvancedservicestomobileornomadiccomputingdevices"/span;write.Write(a_variable);write.Close();fs.Close(); spanclass="code-comment"///spanspanclass="code-comment"Thiscodeisusedtoreaddatafrom.txtfile.../spanFileStreamfs1=spanclass="code-keyword"new/spanFileStream(spanclass="code-string""/spanspanclass="code-string"E:\\a.txt"/span,FileMode.Open);StreamReaderread=spanclass="code-keyword"new/spanStreamReader(fs1);spanclass="code-keyword"string/spanb=read.ReadToEnd();Console.WriteLine(b);read.Close();fs1.Close();/pre/code的
lukeer
评论会员:游客 时间:2012/02/06
我{A1}]类开始进入你的程序保存的数据,或取决于你有什么样的数据在您的应用程序,{A2}先打为您确切的标题加C#是一个页面,告诉你如何做到这一点。BobJanova
从文件读
{体C3} *************** { BR}写入文件
{的C4}
评论会员:md_refay 时间:2012/02/06
是的,我们可以使用像
其他许多技术的Ajax
PHP的
JavaScript的
Java的
jQuery的

jQuery的AJAX和PHP是一个很好的组合
参阅本
{A3的}]