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


C# SessionEventArgs类代码示例

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


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

示例1: OnRequest

        //Test On Request, intecept requests
        //Read browser URL send back to proxy by the injection script in OnResponse event
        public void OnRequest(object sender, SessionEventArgs e)
        {
            Console.WriteLine(e.ProxySession.Request.Url);

            ////read request headers
            //var requestHeaders = e.ProxySession.Request.RequestHeaders;

            //if ((e.RequestMethod.ToUpper() == "POST" || e.RequestMethod.ToUpper() == "PUT"))
            //{
            //    //Get/Set request body bytes
            //    byte[] bodyBytes = e.GetRequestBody();
            //    e.SetRequestBody(bodyBytes);

            //    //Get/Set request body as string
            //    string bodyString = e.GetRequestBodyAsString();
            //    e.SetRequestBodyString(bodyString);

            //}

            ////To cancel a request with a custom HTML content
            ////Filter URL

            //if (e.ProxySession.Request.RequestUrl.Contains("google.com"))
            //{
            //    e.Ok("<!DOCTYPE html><html><body><h1>Website Blocked</h1><p>Blocked by titanium web proxy.</p></body></html>");
            //}
        }
开发者ID:aprilix,项目名称:Titanium-Web-Proxy,代码行数:29,代码来源:ProxyTestController.cs

示例2: session_PlayTokenLost

 void session_PlayTokenLost(ISession sender, SessionEventArgs e)
 {
     this.ParentForm.BeginInvoke(new MethodInvoker(delegate()
         {
             CF_displayMessage("Play token lost! What do we do???" + Environment.NewLine + e.Status.ToString() + Environment.NewLine + e.Message);
         }));
 }
开发者ID:fotiDim,项目名称:spotify-for-centrafuse,代码行数:7,代码来源:Spotify.Session.cs

示例3: session_MessageToUser

 void session_MessageToUser(ISession sender, SessionEventArgs e)
 {
     this.ParentForm.BeginInvoke(new MethodInvoker(delegate()
         {
             CF_displayMessage(e.Message);
         }));
 }
开发者ID:fotiDim,项目名称:spotify-for-centrafuse,代码行数:7,代码来源:Spotify.Session.cs

示例4: session_Exception

 void session_Exception(ISession sender, SessionEventArgs e)
 {
     this.ParentForm.BeginInvoke(new MethodInvoker(delegate()
         {
             WriteError(e.Message);
             CF_displayMessage(e.Status.ToString() + Environment.NewLine + e.Message);
         }));
 }
开发者ID:fotiDim,项目名称:spotify-for-centrafuse,代码行数:8,代码来源:Spotify.Session.cs

示例5: Session

        public void Session()
        {
            Mocks mocks = new Mocks();

            SessionEventArgs s = new SessionEventArgs(mocks.Session.Object);

            Assert.Equal(s.Session, mocks.Session.Object);
        }
开发者ID:rnwood,项目名称:smtp4dev,代码行数:8,代码来源:SessionEventArgsTests.cs

示例6: OnConnectionError

 private void OnConnectionError(object sender, SessionEventArgs e)
 {
     if (e.Status != Error.OK)
     {
         _logger.Log("Connection error " + e.Message + "[" + e.Status + "]", Category.Exception, Priority.High);
     }
     else
     {
         _logger.Log("Connected", Category.Info, Priority.Low);
     }
 }
开发者ID:krikelin,项目名称:torshify-client,代码行数:11,代码来源:SpotifyLogging.cs

示例7: session_LoginComplete

 void session_LoginComplete(ISession sender, SessionEventArgs e)
 {
     this.ParentForm.BeginInvoke(new MethodInvoker(() =>
         {
             if (e.Status != sp_error.OK)
             {
                 CF_displayMessage("Login Failed: " + e.Status + Environment.NewLine + e.Message);
             }
             else
             {
                 OnLoginComplete();
             }
         }));
 }
开发者ID:fotiDim,项目名称:spotify-for-centrafuse,代码行数:14,代码来源:Spotify.Session.cs

示例8: OnResponse

        //Test script injection
        //Insert script to read the Browser URL and send it back to proxy
        public void OnResponse(object sender, SessionEventArgs e)
        {
            ////read response headers
               // var responseHeaders = e.ProxySession.Response.ResponseHeaders;

            //if (!e.ProxySession.Request.Hostname.Equals("medeczane.sgk.gov.tr")) return;
            //if (e.RequestMethod == "GET" || e.RequestMethod == "POST")
            //{
            //    if (e.ProxySession.Response.ResponseStatusCode == "200")
            //    {
            //        if (e.ProxySession.Response.ContentType.Trim().ToLower().Contains("text/html"))
            //        {
            //            string body = e.GetResponseBodyAsString();
            //        }
            //    }
            //}
        }
开发者ID:aprilix,项目名称:Titanium-Web-Proxy,代码行数:19,代码来源:ProxyTestController.cs

示例9: Dispose

        private static void Dispose(TcpClient client, Stream clientStream, CustomBinaryReader clientStreamReader, StreamWriter clientStreamWriter, SessionEventArgs args)
        {
            if (args != null)
                args.Dispose();

            if (clientStreamReader != null)
                clientStreamReader.Dispose();

            if (clientStreamWriter != null)
                clientStreamWriter.Dispose();

            if (clientStream != null)
                clientStream.Dispose();

            if (client != null)
                client.Close();
        }
开发者ID:amitla,项目名称:Titanium,代码行数:17,代码来源:ResponseHandler.cs

示例10: OnSessionStopPlayback

 private void OnSessionStopPlayback(object sender, SessionEventArgs e)
 {
     _logger.Log("Session - Stop playback recevied", Category.Info, Priority.Low);
 }
开发者ID:krikelin,项目名称:torshify-client,代码行数:4,代码来源:PlayerController.cs

示例11: session_ConnectionError

 void session_ConnectionError(ISession sender, SessionEventArgs e)
 {
 }
开发者ID:fotiDim,项目名称:spotify-for-centrafuse,代码行数:3,代码来源:Spotify.Session.cs

示例12: OnSessionEndOfTrack

 private void OnSessionEndOfTrack(object sender, SessionEventArgs e)
 {
     if (Playlist.CanGoNext)
     {
         Playlist.Next();
     }
 }
开发者ID:krikelin,项目名称:torshify-client,代码行数:7,代码来源:PlayerController.cs

示例13: OnSessionPlayerTokenLost

        private void OnSessionPlayerTokenLost(object sender, SessionEventArgs e)
        {
            Pause();

            _eventAggregator
                .GetEvent<NotificationEvent>()
                .Publish(new NotificationMessage("torshify has been paused because your account is used somewhere else"));
        }
开发者ID:krikelin,项目名称:torshify-client,代码行数:8,代码来源:PlayerController.cs

示例14: sessionClosed

 public virtual void sessionClosed(SessionEventArgs e)
 {
 }
开发者ID:BDizzle,项目名称:BeepForNet,代码行数:3,代码来源:SessionAdapter.cs

示例15: UserLoggedOut

 private void UserLoggedOut(object sender, SessionEventArgs e)
 {
     ConsoleEx.WriteLine("Logged out..", ConsoleColor.Yellow);
 }
开发者ID:kms,项目名称:torshify,代码行数:4,代码来源:Program.cs


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