In the Windows programming environment, we have an API function GetHostByName that can be called. Previously we had to implement it through components in Asp.
Similar functions, such as AspDNS, etc. Now MS provides us with a new programming interface on ASP. Net, so that we can easily implement this similar
The reason is that a DNS Class is provided to us in Asp. Net. We can use this Class to easily implement what we mentioned above
Function.
We can see that the following code is a very simple program, but it implements functions that we previously imagined in Asp.
<% @ Import NameSpace = "System. Net" %>
<Script language = "C #" runat = server>
Protected void doClick (Object Src, EventArgs E ){
IPHostEntry hostInfo = DNS. GetHostByName (txtDomain. Text );
Showmsg. Text = hostInfo. AddressList [0]. ToString ();
}
</Script>
<Asp: Label runat = server id = showmsg/>
<Form id = testForm runat = server>
Network domain name to be searched: <asp: TextBox runat = server id = txtDomain/> <asp: Button runat = server id = do Text = "Search" onClick = doClick/>
</Form>
Through the above code, we can see that we only need to further explore Asp. Net functions, and he can indeed implement a lot of us.
Very practical features!
/*
Tofu is made of excellent products
Http://www.asp888.net bean curd technology station
If reprinted, Please retain the complete copyright information
*/