HttpContext.Current.Request
string sessionId = HttpContext.Current.Session.SessionID;
<%@ Page %>
MaintainScrollPositionOnPostback
true
Page_Load
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Request.UserHostAddress
using System.Net;string remoteHost = Request.ServerVariables["REMOTE_HOST"];IPHostEntry client = Dns.GetHostEntry(remoteHost);string clientName = client.HostName;uxClientNameLabel.Text = clientName;
string loginName = System.Threading.Thread.CurrentPrincipal.Identity.Nameusing System.Net;string loginName = Request.ServerVariables["REMOTE_USER"];
string loginName = Request.ServerVariables["AUTH_USER"];
string loginName = System.Web.HttpContext.Current.User.Identity
http://localhost:2297/Version 1.0/
Public Shared ReadOnly Property ApplicationRootUrl() As String Get Dim r As HttpRequest = HttpContext.Current.Request Dim result As String = r.Url.Scheme ' e.g., "http" result &= System.Uri.SchemeDelimiter ' e.g., "://" result &= r.Url.Authority ' e.g., "localhost:86065" result &= r.ApplicationPath ' e.g., "/MyPath/" If Not result.EndsWith("/") Then result &= "/" End If Return result End Get End Property
public static string AppRootUrl { get { var r = HttpContext.Current.Request; var result = r.Url.Scheme; // e.g., "http" result += Uri.SchemeDelimiter; // e.g., "://" result += r.Url.Authority; // e.g., "localhost:86065" result += r.ApplicationPath; // e.g., "/MyPath/" if (!result.EndsWith("/")) result += "/"; return result; } }
ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.