当前位置: 首页>>代码示例>>C#>>正文


C# Service1Client.DoWork方法代码示例

本文整理汇总了C#中Service1Client.DoWork方法的典型用法代码示例。如果您正苦于以下问题:C# Service1Client.DoWork方法的具体用法?C# Service1Client.DoWork怎么用?C# Service1Client.DoWork使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Service1Client的用法示例。


在下文中一共展示了Service1Client.DoWork方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

        static void Main(string[] args)
        {
            //wcf

            IUtilsService iu = new UtilsServiceClient();
            iu.DoWork("a");

            IService1 i1 = new Service1Client();
            i1.DoWork();
            //ITestSrvice

            //CommonHelper.DES des = new CommonHelper.DES();
            //string key = des.GenerateKey();
            //string s0 = "中国软件 - csdn.net";
            //string s1 = des.EncryptString(s0, key);

            //string key1 = des.GenerateKey();

            //string s2 = des.DecryptString(s1, key);

            //var result= System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile("12345678", "MD5");

            //var ss = result == "25d55ad283aa400af464c76d713c07ad".ToUpper();

            //ThreadPool.QueueUserWorkItem(new WaitCallback(o => { Write(); }));

            //ThreadPool.QueueUserWorkItem(new WaitCallback(o => { Read(); }));

            //IUtilsService svic = new UtilsServiceClient();
            //svic.DoWork("cipher_by_randy");
            var sss = "qerqwerwqr".GetHashCode();
            var sss1 = "qerqwerwqr".GetHashCode();
            var q1 = "1".GetHashCode();
            Console.ReadLine();
        }
开发者ID:RandyCode,项目名称:MyFramework,代码行数:35,代码来源:Program.cs

示例2: button1_Click

 private void button1_Click(object sender, EventArgs e)
 {
     using (var client = new Service1Client())
     {
         client.DoWork();
     }
 }
开发者ID:JonasSyrstad,项目名称:Stardust,代码行数:7,代码来源:Form1.cs

示例3: Button1_Click

        protected async void Button1_Click(object sender, EventArgs e)
        {
            var authServer = new AuthorizationServerDescription()
            {
                
                TokenEndpoint = new Uri("http://localhost:53022/OAuth/token "),
                ProtocolVersion = ProtocolVersion.V20
            };
            WebServerClient Client= new WebServerClient(authServer, "idefav", "1");

            var code =await Client.GetClientAccessTokenAsync(new string[] { "http://localhost:55045/IService1/DoWork" });
            string token = code.AccessToken;
            Service1Reference.Service1Client service1Client=new Service1Client();
            var httpRequest = (HttpWebRequest)WebRequest.Create(service1Client.Endpoint.Address.Uri);
            ClientBase.AuthorizeRequest(httpRequest,token);
            var httpDetails = new HttpRequestMessageProperty();
            httpDetails.Headers[HttpRequestHeader.Authorization] = httpRequest.Headers[HttpRequestHeader.Authorization];
            
            using (var scope = new OperationContextScope(service1Client.InnerChannel))
            {
                
                if (OperationContext.Current.OutgoingMessageProperties.ContainsKey(HttpRequestMessageProperty.Name))
                {
                    OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = httpDetails;
                }
                else
                {
                    OperationContext.Current.OutgoingMessageProperties.Add(HttpRequestMessageProperty.Name, httpDetails);
                }
                
                Button1.Text= service1Client.DoWork();
            }


        }
开发者ID:idefav,项目名称:IdefavOAuth2Demo,代码行数:35,代码来源:Default.aspx.cs

示例4: Main

        static void Main(string[] args)
        {
            Service1Client svc = new Service1Client("BasicHttpBinding_IService1", "http://localhost:1759/WebSite1/Service1.svc");
            Console.WriteLine(svc.DoWork("call ws1"));
               svc = new Service1Client("BasicHttpBinding_IService1", "http://localhost:1760/WebSite2/ServiceWs2.svc");
            Console.WriteLine(svc.DoWork("call ws2"));

            Console.Write("frase em portugues?");
            string frase = Console.ReadLine();
            MyTranslatorClient svcT = new MyTranslatorClient();
            Console.WriteLine(svcT.TranslatePortIngles(frase));
        }
开发者ID:pepipe,项目名称:ISEL,代码行数:12,代码来源:Program.cs

示例5: Main

        static void Main(string[] args)
        {
            Service1Client prx = new Service1Client();
            // Para poder usar o TCP Viewer pode intanciar o proxy com outro porto
            //Service1Client prx = new Service1Client("BasicHttpBinding_IService1", "http://localhost:6525/Service1.svc");
            Console.WriteLine("Call Message OneWay=false ");
            Console.WriteLine("Before: "+System.DateTime.Now.ToLongTimeString());
            DataMessage m = new DataMessage();
            m.TextContent="Text"; m.ImageData=new byte[]{1,2,3,4,5};

            prx.DoWork(m.TextContent, m.ImageData);
            Console.WriteLine("After: "+System.DateTime.Now.ToLongTimeString());
            Console.WriteLine("Call OneWay Message");
            Console.WriteLine("Before: "+System.DateTime.Now.ToLongTimeString());
            prx.DoWorkAsOneWay("Luis");
            Console.WriteLine("After: "+System.DateTime.Now.ToLongTimeString());
        }
开发者ID:pepipe,项目名称:ISEL,代码行数:17,代码来源:Program.cs


注:本文中的Service1Client.DoWork方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。