Request
Obtendo IP do Visitante/Usuário
Request.UserHostAddress.ToString();
Obtendo o valor de um item enviado via GET
Request.QueryString["ItemGET"];
Obtendo o valor de um item enviado via POST
Request.Form["ItemPOST"];
Dica:
Use .ToString(); no final do Request para poder usar o valor para uma String. Exemplo String strValorPost = Request.Form["ItemPOST"].ToString();
–
Session
Criando uma Session:
Session["nomeSession"] = "valorSession";
Lendo uma Session:
String strValorSession = Session["nomeSession"];
Exibindo o Timeout da Session:
Response.Write(Session.Timeout.ToString());
Definindo o Timeout:
Removendo:
Session.Remove("nomeSession");
Request
Getting IP of User
Request.UserHostAddress.ToString();
Getting the value of an item sent via GET
Request.QueryString["ItemGET"];
Getting the value of an item sent via POST
Request.Form["ItemPOST"];
Tip:
Use .ToString(); the end of the Request in order to use the value to a String. Sample String strValorPost = Request.Form["ItemPOST"].ToString();
–
Session
Creating a Session
Session["nameSession"] = "amountSession";
Reading a Session
String strValorSession = Session["nameSession"];
View Timeout of Session:
Response.Write(Session.Timeout.ToString());
Setting the TimeOut:
Removing:
Session.Remove("nomeSession");
Request
Ottenere IP del visitatore
Request.UserHostAddress.ToString();
Ottenere il valore di un element inviato tramite GET
Request.QueryString["ItemGET"];
Ottenere il valore di un element inviato tramite POST
Request.Form["ItemPOST"];
Suggerimento:
Usa .ToString(); il fine della richiesta al fine di utilizzare il valore in una stringa. Esempio String strValorPost = Request.Form["ItemPOST"].ToString();
–
Session
Creazione di una Session:
Session["nomeSession"] = "valorSession";
Lettura di una Session:
String strValorSession = Session["nomeSession"];
Lettura di Timeout di Session:
Response.Write(Session.Timeout.ToString());
Impostazione del Timeout:
Rimozione:
Session.Remove("nomeSession");
Request
Получение IP посетителя
Request.UserHostAddress.ToString();
Получение значения пункта отправлено через GET
Request.QueryString["ItemGET"];
Получение значения пункта отправлено по почте
Request.Form["ItemPOST"];
Совет:
Использование .ToString(); конце запроса, чтобы использовать значение в строку. Пример String strValorPost = Request.Form["ItemPOST"].ToString();
–
Session
Создание сессии:
Session["nomeSession"] = "valorSession";
Чтение сессии:
String strValorSession = Session["nomeSession"];
Просмотр сессии вышло:
Response.Write(Session.Timeout.ToString());
Настройка вышло:
Удаление:
Session.Remove("nomeSession");