ASP: GetHostByAddress

i've tried using the ASP GetHostByAddress function to resolve the hostname (or at least the domain) of my visitors.


WHILE NOT RS.EOF
Response.Write("<tr>" & chr(10) & chr(13))
Response.Write("<td class='data'>" & RS("IP_Addr") & "</td>" & chr(10) & chr(13))
Response.Write("<td class='data'>" & RS("Date") & "</td>" & chr(10) & chr(13))

Response.Write("<td class='data'>" & Dns.GetHostByAddress(RS("IP_Addr")) & "</td>" & chr(10) & chr(13))


Response.Write("</tr>" & chr(10) & chr(13))

RS.MoveNext
WEND


but I am getting an error - it is "expecting an object" on the line where I am using the function.

what have i not done?Dns is a .net class....., looks like classic ASP there not ASP.netah - yes...

is there a way to do it in ASP?

I can do it in PHP, but the rest of the stats scripts are in ASPOnly through components.

search for DNS lite C# component. it can be writen in VB with winsocks to make a VB COM object that can do it. Otherwise IP*Works or other AspDns will work.you lost me there... :eek:There is no direct way to do it in ASP.

However there are components that you can purchase or you can build one yourself that can do it.components....

what be they and how do I?http://www.aspin.com/home/components/internet/dns

This part of Aspin is devoted to just these types of scripts

you should be able to find one of them that will work for you.cheers for all help - and I'm sure that others will find it useful too.

however, I am simply using the user agent to determine bot's...You could just compile a custom .net library to export the object into a COM wrappered .net component.....

In VS.net use the option on the project configs to Register COM object or Generate Type Library.

Only deal is that your required to adhere to the COM specs and base your class on a COM Exposed Interface that will be exposed as the VTable for COM... (Vtables are inherent in C++, they tell the program the offset to the actual function( ie xxx@4 is the symbol that points to xxx(sub note: @4 is the byte alignment))) wow a lot of information htere...Originally posted by afterburn
You could just compile a custom .net library to export the object into a COM wrappered .net component.....

In VS.net use the option on the project configs to Register COM object or Generate Type Library.

Only deal is that your required to adhere to the COM specs and base your class on a COM Exposed Interface that will be exposed as the VTable for COM... (Vtables are inherent in C++, they tell the program the offset to the actual function( ie xxx@4 is the symbol that points to xxx(sub note: @4 is the byte alignment))) wow a lot of information htere...

Okay, Mr. Over-the-top ;) :POriginally posted by putts
Okay, Mr. Over-the-top ;) :P

Just wanted to make sure he understood ... and not be misleading with the COM/.net and the differences... he could just expose the stuff as COM objects relying on .net to do the work...


Its better to explain how it all works underneath than just explain a solution IMHO, as it will allow him to build better solutions ...well, my head is about 6 feet, but I think you were aiming for the statue of liberty when you threw all that at me...Well you sound to be more apt with PHP than ASP. Wanted to explain that you can make .net components that can be used in ASP.

A bit of explaination of how COM works gives you a good idea on how to build COM objects yourself instead of always creating ASP pages you can create COM+ apps or COM objects, they are compiled so you get 10 times the speed out of them.

COM is awesome when building large scale websites.
 
Back
Top