資源簡介
本例的服務(wù)是接收發(fā)來的文字信息保存,并發(fā)送給用戶。
WinForm發(fā)送文字信息,并每2秒刷新從服務(wù)取得的文字信息。
1、配置好IIS,指向TentWebService.asmx文件夾和文件,百度IIS配置;
2、編寫修改完TentWebService.asmx,點(diǎn)右鍵“發(fā)布”;
3、WinForm里點(diǎn)右鍵選擇“添加”、“服務(wù)引用”,指向IIS的地址,點(diǎn)擊“轉(zhuǎn)到”,再輸入“命名空間”。
WEB部分
namespace TentServeric
{
/// <summary>
/// TentWebService 的摘要說明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// 若要允許使用 ASP.NET AJAX 從腳本中調(diào)用此 Web 服務(wù),請取消注釋以下行。
// [System.Web.Script.Services.ScriptService]
public class TentWebService : System.Web.Services.WebService
{
[WebMethod]
public void Total_Message (string message)
{
Msglist.msg = "{$}" message;
}
[WebMethod]
public string Send_Message ()
{
string send = Msglist.msg;
return send;
}
}
}
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Text;
using?System.Threading;
using?System.Threading.Tasks;
using?System.Windows.Forms;
namespace?test
{
????public?static?class?CrossThreadCall
????{
????????public?static?void?CrossThreadCalls(this?Control?ctl?ThreadStart?del)
????????{
????????????if?(del?==?null)?return;
????????????if?(ctl.InvokeRequired)
????????????????ctl.Invoke(del?null);
????????????else
????????????????del();
????????}
????}
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
????..A..H.?????44544??2017-09-23?23:52??Test_WinForm測試\test\.vs\test\v14\.suo
?????文件????????687??2017-09-23?23:44??Test_WinForm測試\test\App.config
?????文件??????13312??2017-09-23?23:50??Test_WinForm測試\test\bin\Debug\test.exe
?????文件????????687??2017-09-23?23:44??Test_WinForm測試\test\bin\Debug\test.exe.config
?????文件??????34304??2017-09-23?23:50??Test_WinForm測試\test\bin\Debug\test.pdb
?????文件??????22696??2017-09-24?00:02??Test_WinForm測試\test\bin\Debug\test.vshost.exe
?????文件????????687??2017-09-23?23:44??Test_WinForm測試\test\bin\Debug\test.vshost.exe.config
?????文件????????490??2017-03-19?05:00??Test_WinForm測試\test\bin\Debug\test.vshost.exe.manifest
?????文件????????516??2017-09-23?23:25??Test_WinForm測試\test\CrossThreadCall.cs
?????文件???????1865??2017-09-23?23:50??Test_WinForm測試\test\Form1.cs
?????文件???????3532??2017-09-23?23:50??Test_WinForm測試\test\Form1.Designer.cs
?????文件???????5817??2017-09-23?23:50??Test_WinForm測試\test\Form1.resx
?????文件???????7972??2017-09-23?23:44??Test_WinForm測試\test\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件??????????0??2017-09-23?21:08??Test_WinForm測試\test\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
?????文件??????????0??2017-09-23?21:08??Test_WinForm測試\test\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
?????文件??????????0??2017-09-23?21:08??Test_WinForm測試\test\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
?????文件???????5632??2017-09-23?21:54??Test_WinForm測試\test\obj\Debug\TempPE\Service?References.call_server.Reference.cs.dll
?????文件???????6656??2017-09-23?23:12??Test_WinForm測試\test\obj\Debug\TempPE\Service?References.Call_Serveric.Reference.cs.dll
?????文件???????6656??2017-09-23?23:44??Test_WinForm測試\test\obj\Debug\TempPE\Service?References.Call_Service.Reference.cs.dll
?????文件????????432??2017-09-24?00:02??Test_WinForm測試\test\obj\Debug\test.csproj.FileListAbsolute.txt
?????文件???????1012??2017-09-23?23:50??Test_WinForm測試\test\obj\Debug\test.csproj.GenerateResource.Cache
?????文件??????13312??2017-09-23?23:50??Test_WinForm測試\test\obj\Debug\test.exe
?????文件????????180??2017-09-23?23:50??Test_WinForm測試\test\obj\Debug\test.Form1.resources
?????文件??????34304??2017-09-23?23:50??Test_WinForm測試\test\obj\Debug\test.pdb
?????文件????????180??2017-09-23?23:50??Test_WinForm測試\test\obj\Debug\test.Properties.Resources.resources
?????文件????????516??2017-09-23?21:08??Test_WinForm測試\test\Program.cs
?????文件???????1316??2017-09-23?21:08??Test_WinForm測試\test\Properties\AssemblyInfo.cs
?????文件???????2821??2017-09-23?21:08??Test_WinForm測試\test\Properties\Resources.Designer.cs
?????文件???????5612??2017-09-23?21:08??Test_WinForm測試\test\Properties\Resources.resx
?????文件???????1091??2017-09-23?21:08??Test_WinForm測試\test\Properties\Settings.Designer.cs
............此處省略175個(gè)文件信息
評(píng)論
共有 條評(píng)論
相關(guān)資源
- c#入門經(jīng)典 第七版 中文版 非掃描版
- .netc#新手菜鳥mvc5的倉庫管理系統(tǒng) so
- C# NPOI生成word插入圖片和表格
- C#程序設(shè)計(jì)基礎(chǔ)C#程序設(shè)計(jì)及應(yīng)用教程
- 深入.NET平臺(tái)和C#編程
- .net 美萍超市管理系統(tǒng)源碼C#
- WinForm GeckoFx33 Demo JS與C#互交 窗口瀏覽
- 《ASP.NET程序設(shè)計(jì)項(xiàng)目教程》周虎,王
- 計(jì)算機(jī)圖形學(xué) 三維模型處理算法初步
- C# KTV 點(diǎn)歌系統(tǒng),C#項(xiàng)目源碼帶數(shù)據(jù)庫
- C#實(shí)驗(yàn)--A.1 視頻動(dòng)態(tài)繪制練習(xí).
- c#實(shí)現(xiàn)動(dòng)態(tài)規(guī)劃法——求解矩陣連乘問
- c#winform中完美代替WebBrowser最新的控件
- C#高級(jí)編程第9版:C#5.0 & .NET 4.5.1 par
- Illustrated C# 2010 C# 4.0圖解教程
- C# WINFORM框架源碼
- C# WinForm實(shí)踐開發(fā)教程清晰版
- 3D打印機(jī)上位機(jī)源碼Reprap Host 是C#寫的
- C#設(shè)計(jì)模式+源碼JamesW.Cooper.zip
- C#程序開發(fā)范例寶典(第3版).(配套
- C#寫的年會(huì)抽獎(jiǎng)軟件包含源代碼.zip
- 大型ERP C#源碼
- asp.net完整項(xiàng)目帶數(shù)據(jù)庫
- 一種開源業(yè)務(wù)系統(tǒng)框架winform源碼
- 清大出版社 段德亮 《C#課程設(shè)計(jì)案例
- C#人事管理系統(tǒng)/人力資源管理系統(tǒng)
- C# 7 and .NET Core: Modern Cross-Platform Deve
- C# 5.0 in a Nutshell 5th Edition.pdf
-
C# 6.0 and the .NET 4.6 fr
amework(7th). - C# .NET webservices簡單使用