Jump to content
Fórum Script Brasil
  • 0
Sign in to follow this  
Guest Ricardo Nepomuceno

Como Exibir O Número Ip Em Uma Página Aspx

Question

Guest Ricardo Nepomuceno

Salve pessoal,

como faço para que seja exibido o número ip em uma página em asp.net

fico no aguardo

abraços

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0
Guest Ricardo Nepomuceno

fiz isso aqui e não funcionou

<%@ Page Language="vb" %>

<HTML>

<HEAD>

<title>nvariavel</title>

</HEAD>

<body MS_POSITIONING="GridLayout">

<TABLE height="35" cellSpacing="0" cellPadding="0" width="11" border="0" ms_2d_layout="TRUE">

<TR vAlign="top">

<TD width="10" height="15"></TD>

<TD width="1"></TD>

</TR>

<TR vAlign="top">

<TD height="20"></TD>

<TD>

<script runat="server">

dim vip as integer = Request.ServerVariables("REMOTE_ADDR")

sub page_load(obj as object, e as eventargs)

response.write ("o número do ip é : ")

response.write (vip & "<p>")

end sub

</script>

</TD>

</TR>

</TABLE>

</body>

</HTML>

Share this post


Link to post
Share on other sites
  • 0

dim vip as integer = Request.ServerVariables("REMOTE_ADDR")

O retorno do ServerVariables é string, não integer.

tente isso:

<script runat="server" language="C#">

void Page_Load(object sender, EventArgs e)
{
	ip.InnerText = Request.ServerVariables["REMOTE_ADDR"];
}
</script>
<html>
<body>
<div style="color: navy;" id="ip" runat="server"></div>
</body>
</html>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

Cloud Computing


  • Forum Statistics

    • Total Topics
      148079
    • Total Posts
      643267
×
×
  • Create New...