IMO this approach won't work anyway. Keep in mind that as I said the ASP
page runs SERVER SIDE i.e. you'll get the name of the server if this code
runs from the ASP page. This code should run CLIENT SIDE but the user will
have to accept your ActiveX control etc...
I saw in another thread that the goal is that you want to create
automatically a user name upon registration. If this is in your company you
could just use integrated authentication so that the web site automatically
knows who is the user (uisng Request.ServerVariables("AUTH_USER")).
If not it won't work anyway as you could have multiple users having the same
computer name for example (beside the difficulty that likely not worth). See
around and you'll see that you have no web site using this info to create a
user name.
Generaly it is done by using some information entered by the user (email,
some calculation based upon the user lastname and firstname etc...). In some
cases it is just a "random" username (for example some random letters
followed by some random numbers).
--
Patrice
<iskofajardo@yahoo.com> a écrit dans le message de news:
1165929809.578329.287070@l12g2000cwl.googlegroups.com...
how can i create a wrapper DLL, coz i really don't try it even before.
[quoted text, click to view] Patrice wrote:
> You can't call an API directly from an ASP page. You could create a
> wrapper
> DLL to call this API.
>
> But keep also in mind that the ASP code runs server side.
>
> Here it looks like you want to get the client computer name. The best you
> can easily do would be to use the REMOTE_HOST server variables to get its
> name or IP (likely IP).
>
> Try :
>
http://www.w3schools.com/asp/coll_servervariables.asp >
> Else you could perhaps use a scripting object suhc as :
>
http://www.winguides.com/scripting/reference.php?id=127 but i('s likely
> you'll have to alter the security settings as this is likely not supposed
> to
> be available to all websites you are visiting.
>
> If this is because you want the application to be available from
> partiuclar
> computers this is AFAIK quite difficult. The best you could easily do
> would
> be to make sure that only a single account can use the application from a
> single computer at a time (i.e. not possible to open multiple sessions
> under
> the same account). Also what if the user changes its computer...
>
> --
> Patrice
>
> <iskofajardo@yahoo.com> a écrit dans le message de news:
> 1165909982.774650.241420@n67g2000cwd.googlegroups.com...
> > hello there... i'm just thinking about the windows api with asp.. is it
> > posible to attach or put the windows api code inside the asp? because i
> > want to retrieve a client computer name. so i decided to use the
> > windows api, is it possible? can somebody give me sample?
> >
> > another question, how can i retrieve a client computer name using
> > serverVariable? coz i'm using that string in registration form.. i want
> > automatically call or get the computer name...
> >
> > thanks in advance...
> >