本文整理汇总了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();
}
示例2: button1_Click
private void button1_Click(object sender, EventArgs e)
{
using (var client = new Service1Client())
{
client.DoWork();
}
}
示例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();
}
}
示例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));
}
示例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());
}