• 大小: 0.18M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-02-26
  • 语言: C#
  • 标签: WCF  简单  测试  C#  

资源简介

WCF的简单使用

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Service.Interface;
using System.ServiceModel;

namespace ChannelFactoryClient
{
    class Program
    {
        static void Main(string[] args)
        {
            Task.Factory.StartNew(() =>
            {
                using (ChannelFactory channelFactory = new ChannelFactory(“Tcp1_CalculatorService“))
                {
                    for (int i = 0; i < 1; i++)
                    {
                        Task.Factory.StartNew(() =>
                        {
                            ICalculator proxy = channelFactory.CreateChannel();
                            Console.WriteLine(“x/y={2} when x={0} and y={1}“ 1 0 proxy.Divide(1 0));
                        });
                    }
                    Console.Read();
                }
            });

            Task.Factory.StartNew(() =>

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2020-05-18 11:32  WCFService\
     目录           0  2020-05-15 11:14  WCFService\.vs\
     目录           0  2020-05-15 11:13  WCFService\.vs\WCFServices\
     目录           0  2020-05-15 11:13  WCFService\.vs\WCFServices\v14\
     文件      144896  2020-05-18 14:43  WCFService\.vs\WCFServices\v14\.suo
     目录           0  2020-05-18 14:43  WCFService\ChannelFactoryClient\
     文件        2896  2020-05-18 14:43  WCFService\ChannelFactoryClient\App.config
     目录           0  2020-05-15 14:13  WCFService\ChannelFactoryClient\bin\
     目录           0  2020-05-18 14:44  WCFService\ChannelFactoryClient\bin\Debug\
     文件        7168  2020-05-18 14:44  WCFService\ChannelFactoryClient\bin\Debug\ChannelFactoryClient.exe
     文件        2896  2020-05-18 14:43  WCFService\ChannelFactoryClient\bin\Debug\ChannelFactoryClient.exe.config
     文件       15872  2020-05-18 14:44  WCFService\ChannelFactoryClient\bin\Debug\ChannelFactoryClient.pdb
     文件       22696  2020-05-18 11:26  WCFService\ChannelFactoryClient\bin\Debug\ChannelFactoryClient.vshost.exe
     文件        2588  2020-05-18 11:25  WCFService\ChannelFactoryClient\bin\Debug\ChannelFactoryClient.vshost.exe.config
     文件         490  2019-03-19 12:46  WCFService\ChannelFactoryClient\bin\Debug\ChannelFactoryClient.vshost.exe.manifest
     文件        4608  2020-05-18 14:44  WCFService\ChannelFactoryClient\bin\Debug\Service.Interface.dll
     文件        7680  2020-05-18 14:44  WCFService\ChannelFactoryClient\bin\Debug\Service.Interface.pdb
     文件        3034  2020-05-15 15:56  WCFService\ChannelFactoryClient\ChannelFactoryClient.csproj
     目录           0  2020-05-15 14:13  WCFService\ChannelFactoryClient\obj\
     目录           0  2020-05-18 14:44  WCFService\ChannelFactoryClient\obj\Debug\
     文件        1460  2020-05-18 14:44  WCFService\ChannelFactoryClient\obj\Debug\ChannelFactoryClient.csproj.FileListAbsolute.txt
     文件        6024  2020-05-18 14:44  WCFService\ChannelFactoryClient\obj\Debug\ChannelFactoryClient.csprojResolveAssemblyReference.cache
     文件        7168  2020-05-18 14:44  WCFService\ChannelFactoryClient\obj\Debug\ChannelFactoryClient.exe
     文件       15872  2020-05-18 14:44  WCFService\ChannelFactoryClient\obj\Debug\ChannelFactoryClient.pdb
     文件        6949  2020-05-15 16:56  WCFService\ChannelFactoryClient\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件           0  2020-05-15 14:13  WCFService\ChannelFactoryClient\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
     文件           0  2020-05-15 14:13  WCFService\ChannelFactoryClient\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
     文件           0  2020-05-15 14:13  WCFService\ChannelFactoryClient\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
     目录           0  2020-05-15 14:13  WCFService\ChannelFactoryClient\obj\Debug\TempPE\
     文件        2249  2020-05-18 14:43  WCFService\ChannelFactoryClient\Program.cs
     目录           0  2020-05-15 14:13  WCFService\ChannelFactoryClient\Properties\
............此处省略122个文件信息

评论

共有 条评论