• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Client类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Client的典型用法代码示例。如果您正苦于以下问题:C# Client类的具体用法?C# Client怎么用?C# Client使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Client类属于命名空间,在下文中一共展示了Client类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetNotes

 public static async Task<Note[]> GetNotes(Client client, string orderId)
 {
     return
         (await
             client.MakeGetRequest<Notes>(client.ConcatAccountPath(string.Format("{0}/{1}/notes", PortOutPath, orderId))))
             .List;
 }
开发者ID:dwimsey,项目名称:csharp-bandwidth-iris,代码行数:7,代码来源:ImportToAccount.cs


示例2: Mesh

        /// <summary>
        /// Create a new mesh for the given client using shader as the default shader
        /// </summary>
        /// <param name="client"></param>
        /// <param name="shader"></param>
        public Mesh(Client client, Shader shader)
        {
            Client = client;
            Shader = shader;

            Id = CSycles.scene_add_mesh(Client.Id, Client.Scene.Id, Client.Scene.GetShaderSceneId(shader));
        }
开发者ID:jesterKing,项目名称:CCSycles,代码行数:12,代码来源:Mesh.cs


示例3: HandleDoProcessStart

        public static void HandleDoProcessStart(Packets.ServerPackets.DoProcessStart command, Client client)
        {
            if (string.IsNullOrEmpty(command.Processname))
            {
                new Packets.ClientPackets.SetStatus("Process could not be started!").Execute(client);
                return;
            }

            try
            {
                ProcessStartInfo startInfo = new ProcessStartInfo
                {
                    UseShellExecute = true,
                    FileName = command.Processname
                };
                Process.Start(startInfo);
            }
            catch
            {
                new Packets.ClientPackets.SetStatus("Process could not be started!").Execute(client);
            }
            finally
            {
                HandleGetProcesses(new Packets.ServerPackets.GetProcesses(), client);
            }
        }
开发者ID:nhymxu,项目名称:xRAT,代码行数:26,代码来源:SystemHandler.cs


示例4: VM

 public VM()
 {
     //get a handler to the Lync Client, then subscribe to state changes.
     _client = LyncClient.GetClient();
     _client.StateChanged += _client_StateChanged;
     SubscribetoPresenceIfSignedIn(_client.State);
 }
开发者ID:NALSS,项目名称:LyncPauseMusicOnCall,代码行数:7,代码来源:VM.cs


示例5: FrmRemoteWebcam

        public FrmRemoteWebcam(Client c)
        {
            _connectClient = c;
            _connectClient.Value.FrmWebcam = this;

            InitializeComponent();
        }
开发者ID:GeekGalaxy,项目名称:QuasarRAT,代码行数:7,代码来源:FrmRemoteWebcam.cs


示例6: Main

 public static void Main(Client client)
 {
     foreach (var vip in client.Vip.GetCharacters())
     {
         client.Vip.Remove(vip);
     }
 }
开发者ID:KyLuaa,项目名称:bot,代码行数:7,代码来源:VipRemoveAll.cs


示例7: Start

 void Start()
 {
     Application.runInBackground = true;
     client = new Client(PORT, "192.168.1.101");
     client.Work();
     sendMessage = forPrint;
 }
开发者ID:comradgrey,项目名称:Chat,代码行数:7,代码来源:Chat.cs


示例8: SaveSpells

 public static void SaveSpells(Client.GameState client)
 {
     if (client.Entity == null)
         return;
     if (client.Spells == null)
         return;
     if (client.Spells.Count == 0)
         return;
     foreach (Interfaces.ISkill spell in client.Spells.Values)
     {
         if(spell.Available)
         {
             MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
             cmd.Update("skills").Set("Level", spell.Level).Set("PreviousLevel", spell.PreviousLevel)
                 .Set("Experience", spell.Experience).Where("EntityID", client.Entity.UID).And("ID", spell.ID).Execute();
         }
         else
         {
             spell.Available = true;
             MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
             cmd.Insert("skills").Insert("Level", spell.Level).Insert("Experience", spell.Experience).Insert("EntityID", client.Entity.UID)
                 .Insert("Type", "Spell").Insert("ID", spell.ID).Execute();
         }
     }
 }
开发者ID:faresali,项目名称:co-pserver,代码行数:25,代码来源:Copy+of+SkillTable.cs


示例9: Read

 protected override void Read(Client client, NReader rdr)
 {
     Time = rdr.ReadInt32();
     BulletId = rdr.ReadByte();
     ObjectId = rdr.ReadInt32();
     TargetId = rdr.ReadInt32();
 }
开发者ID:BlackRayquaza,项目名称:MMOE,代码行数:7,代码来源:OtherHitPacket.cs


示例10: HandleDoDownloadFile

        public static void HandleDoDownloadFile(Packets.ServerPackets.DoDownloadFile command, Client client)
        {
            new Thread(() =>
            {
                try
                {
                    FileSplit srcFile = new FileSplit(command.RemotePath);
                    if (srcFile.MaxBlocks < 0)
                        new Packets.ClientPackets.DoDownloadFileResponse(command.ID, "", new byte[0], -1, -1,
                            srcFile.LastError).Execute(client);

                    for (int currentBlock = 0; currentBlock < srcFile.MaxBlocks; currentBlock++)
                    {
                        if (!client.Connected) return;
                        if (_canceledDownloads.ContainsKey(command.ID)) return;

                        byte[] block;
                        if (srcFile.ReadBlock(currentBlock, out block))
                        {
                            new Packets.ClientPackets.DoDownloadFileResponse(command.ID,
                                Path.GetFileName(command.RemotePath), block, srcFile.MaxBlocks, currentBlock,
                                srcFile.LastError).Execute(client);
                        }
                        else
                            new Packets.ClientPackets.DoDownloadFileResponse(command.ID, "", new byte[0], -1, -1,
                                srcFile.LastError).Execute(client);
                    }
                }
                catch (Exception ex)
                {
                    new Packets.ClientPackets.DoDownloadFileResponse(command.ID, "", new byte[0], -1, -1, ex.Message)
                        .Execute(client);
                }
            }).Start();
        }
开发者ID:nhymxu,项目名称:xRAT,代码行数:35,代码来源:FileHandler.cs


示例11: StreamFetcher

 public StreamFetcher(DataServiceContextWrapper context, EntityBase entity, string propertyName, Client.DataServiceStreamLink link)
 {
     _context = context;
     _entity = entity;
     _link = link;
     _propertyName = propertyName;
 }
开发者ID:iambmelt,项目名称:Vipr,代码行数:7,代码来源:StreamFetcher.cs


示例12: ChangeDungeonCoords

        public static void ChangeDungeonCoords(Client client, Enums.Direction dir)
        {
            int dist = 1;
            int rand = Server.Math.Rand(1, 10000);
            if (rand <= 66) { //.66% chance warp
                exPlayer.Get(client).DungeonX = Server.Math.Rand(0, exPlayer.Get(client).DungeonMaxX-1);
                exPlayer.Get(client).DungeonY = Server.Math.Rand(0, exPlayer.Get(client).DungeonMaxY-1);
                return;
            } else if (rand <= 666) { //6% chance skip
                dist = 2;
            }

            if (dir == Enums.Direction.Up) {
                exPlayer.Get(client).DungeonY = exPlayer.Get(client).DungeonY - dist;
                if (exPlayer.Get(client).DungeonY < 0) {
                    exPlayer.Get(client).DungeonY += exPlayer.Get(client).DungeonMaxY;
                }
            } else if (dir == Enums.Direction.Down) {
                exPlayer.Get(client).DungeonY = (exPlayer.Get(client).DungeonY + dist) % exPlayer.Get(client).DungeonMaxY;
            } else if (dir == Enums.Direction.Left) {
                exPlayer.Get(client).DungeonX = exPlayer.Get(client).DungeonX - dist;
                if (exPlayer.Get(client).DungeonX < 0) {
                    exPlayer.Get(client).DungeonX += exPlayer.Get(client).DungeonMaxX;
                }
            } else if (dir == Enums.Direction.Right) {
                exPlayer.Get(client).DungeonX = (exPlayer.Get(client).DungeonX + dist) % exPlayer.Get(client).DungeonMaxX;
            }
        }
开发者ID:ScruffyKnight,项目名称:PMU-Server,代码行数:28,代码来源:PitchBlackAbyss.cs


示例13: UserInfo

 public UserInfo(string user, string pass, Client conn)
 {
     this.UserName = user;
     this.Password = pass;
     this.LoggedIn = true;
     this.Connection = conn;
 }
开发者ID:ristokippa,项目名称:Instant_Messenger,代码行数:7,代码来源:UserInfo.cs


示例14: CanCalculate

        public void CanCalculate()
        {
            var client = new Client(new Uri(AmeeUrl), AmeeUserName, AmeePassword);
            var value = client.Calculate("transport/defra/fuel", "9DE1D9435784", new ValueItem("volume", "10"));

            Assert.AreEqual(value.Amounts.Amount[0].Value, "4.7385");
        }
开发者ID:bitpusher,项目名称:AMEE,代码行数:7,代码来源:DefraFixture.cs


示例15: Form1

        public Form1()
        {
            InitializeComponent();

            // Turn on key preview
            this.KeyPreview = true;

            // Allocate Kinect data structure for speed
            data = new KinectData();

            // Allocate bitmaps for speed
            //!! Should use System.Windows.Media.Imaging.WriteableBitmap
            colorBitmap = new Bitmap(640, 480, PixelFormat.Format24bppRgb);
            depthBitmap = new Bitmap(640, 480, PixelFormat.Format24bppRgb);
            testBitmap = new Bitmap(640, 480, PixelFormat.Format24bppRgb);
            demoBitmap = new Bitmap(640, 480, PixelFormat.Format24bppRgb);

            // Set up session parameters
            SessionParameters sessionParams = new SessionParameters(KinectDataParams.EnableType.All);
            sessionParams.DataParams.validityImageEnable = false;
            sessionParams.DataParams.testImageEnable = false;

            // Connect to a local Kinect and hook up to the data event
            client = KinectTableNet.KinectTable.ConnectLocal(sessionParams);
            client.DataReady += new Client.DataReadyHandler(client_DataReady);

            return;
        }
开发者ID:AaronGenest,项目名称:KinectArms,代码行数:28,代码来源:Form1.cs


示例16: Write

 protected override void Write(Client client, NWriter wtr)
 {
     wtr.Write(Time);
     wtr.Write(BulletId);
     wtr.Write(ObjectId);
     wtr.Write(TargetId);
 }
开发者ID:BlackRayquaza,项目名称:MMOE,代码行数:7,代码来源:OtherHitPacket.cs


示例17: HandleGetDesktopResponse

        public static void HandleGetDesktopResponse(Client client, GetDesktopResponse packet)
        {
            if (client.Value == null || client.Value.FrmRdp == null)
                return;

            if (packet.Image == null)
                return;

            if (client.Value.StreamCodec == null)
                client.Value.StreamCodec = new UnsafeStreamCodec(packet.Quality, packet.Monitor, packet.Resolution);

            if (client.Value.StreamCodec.ImageQuality != packet.Quality || client.Value.StreamCodec.Monitor != packet.Monitor
                || client.Value.StreamCodec.Resolution != packet.Resolution)
            {
                if (client.Value.StreamCodec != null)
                    client.Value.StreamCodec.Dispose();

                client.Value.StreamCodec = new UnsafeStreamCodec(packet.Quality, packet.Monitor, packet.Resolution);
            }

            using (MemoryStream ms = new MemoryStream(packet.Image))
            {
                client.Value.FrmRdp.UpdateImage(client.Value.StreamCodec.DecodeData(ms), true);
            }

            packet.Image = null;

            if (client.Value != null && client.Value.FrmRdp != null && client.Value.FrmRdp.IsStarted)
                new GetDesktop(packet.Quality, packet.Monitor).Execute(client);
        }
开发者ID:peters,项目名称:QuasarRAT,代码行数:30,代码来源:SurveillanceHandler.cs


示例18: CreateNewParty

        public void CreateNewParty(Client c)
        {
            if (GetCurrentPartyForClient(c) != null)
                return; // For now

            parties.Add(new Party(c.User.Username, c), c.User.Username);
        }
开发者ID:ChowZenki,项目名称:PolarisServer,代码行数:7,代码来源:PartyManager.cs


示例19: Init

 public override bool Init(Client client)
 {
     Hashtable data = new Hashtable();
     data.Add("Title", "Comming soon... :)");
     client.HttpSend(TemplateActivator.Activate(this, client, data));
     return true;
 }
开发者ID:GiByteNET,项目名称:GameSlot,代码行数:7,代码来源:ComingSoonPage.cs


示例20: PayWithError

        public void PayWithError(PaymentModel payment, string responseData, JudoApiError errorType)
        {
            var httpClient = Substitute.For<IHttpClient>();
            var response = new HttpResponseMessage(HttpStatusCode.BadRequest) { Content = new StringContent(responseData) };
            response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
            var responseTask = new TaskCompletionSource<HttpResponseMessage>();
            responseTask.SetResult(response);

            httpClient.SendAsync(Arg.Any<HttpRequestMessage>()).Returns(responseTask.Task);

            var client = new Client(new Connection(httpClient, DotNetLoggerFactory.Create, "http://something.com"));

            var judo = new JudoPayApi(DotNetLoggerFactory.Create, client);

            IResult<ITransactionResult> paymentReceiptResult = null;

            // ReSharper disable CanBeReplacedWithTryCastAndCheckForNull
            if (payment is CardPaymentModel)
            {
                paymentReceiptResult = judo.Payments.Create((CardPaymentModel)payment).Result;
            }
            else if (payment is TokenPaymentModel)
            {
                paymentReceiptResult = judo.Payments.Create((TokenPaymentModel)payment).Result;
            }
            // ReSharper restore CanBeReplacedWithTryCastAndCheckForNull

            Assert.NotNull(paymentReceiptResult);
            Assert.IsTrue(paymentReceiptResult.HasError);
            Assert.IsNull(paymentReceiptResult.Response);
            Assert.IsNotNull(paymentReceiptResult.Error);
            Assert.AreEqual((int)errorType, paymentReceiptResult.Error.Code);
        }
开发者ID:JudoPay,项目名称:DotNetSDK,代码行数:33,代码来源:PaymentTests.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Client.Connection类代码示例发布时间:2022-05-24
下一篇:
C# ClickedHandler类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap