asp
am 12.12.2006 08:53:02 von iskofajardo
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...
Re: asp
am 12.12.2006 13:04:10 von Patrice
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
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...
>
Re: asp
am 12.12.2006 14:16:45 von iskofajardo
thank you so much for the information Patrice...
coz before i thought that the code of windows api can also call
directly to the asp..
Patrice wrote:
> You can't call an API directly from an ASP page. You could create a wrapp=
er
> 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=3D127 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 partiucl=
ar
> computers this is AFAIK quite difficult. The best you could easily do wou=
ld
> 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 un=
der
> the same account). Also what if the user changes its computer...
>
> --
> Patrice
>
> a =E9crit 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...
> >
Re: asp
am 12.12.2006 14:23:29 von iskofajardo
how can i create a wrapper DLL, coz i really don't try it even before.
Patrice wrote:
> You can't call an API directly from an ASP page. You could create a wrapp=
er
> 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=3D127 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 partiucl=
ar
> computers this is AFAIK quite difficult. The best you could easily do wou=
ld
> 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 un=
der
> the same account). Also what if the user changes its computer...
>
> --
> Patrice
>
> a =E9crit 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...
> >
Re: asp
am 13.12.2006 09:57:22 von Patrice
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
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.
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
>
> 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...
> >
Re: asp
am 13.12.2006 11:24:57 von iskofajardo
ok... thanx for the information again...
can i asked another question? ok, do you have any sample contol which
is using Windows API code with ASP? or even in ASP.NET?
coz i only try to use the Windows API code inside the Visual Basic6.0
in getting the computer name. where can i use Wimdows API, as a CLIENTS
SIDE or a SERVER SIDE?
Patrice wrote:
> 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 y=
ou
> could just use integrated authentication so that the web site automatical=
ly
> 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 s=
ame
> 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 s=
ome
> cases it is just a "random" username (for example some random letters
> followed by some random numbers).
>
> --
> Patrice
>
> a =E9crit 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.
>
>
> 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 y=
ou
> > can easily do would be to use the REMOTE_HOST server variables to get i=
ts
> > 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=3D127 but i('s like=
ly
> > you'll have to alter the security settings as this is likely not suppos=
ed
> > 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
> >
> > a =E9crit 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 wa=
nt
> > > automatically call or get the computer name...
> > >
> > > thanks in advance...
> > >
Re: asp
am 13.12.2006 13:52:09 von Patrice
As said earlier if you really want to, you could reuse the WScript.Network
object (but not sure it will run client side with default security settings)
:
http://www.winguides.com/scripting/reference.php?id=127
FYI, how to create an ActiveX DLL. For example with VB 5 :
http://support.microsoft.com/kb/193998/en-us (VB could then use the Declare
statement to call a Windows API call).
Should be fine technically but I still suggest to double check the trade off
between your needs and usability...
--
Patrice
a écrit dans le message de news:
1166005496.888911.52020@j72g2000cwa.googlegroups.com...
ok... thanx for the information again...
can i asked another question? ok, do you have any sample contol which
is using Windows API code with ASP? or even in ASP.NET?
coz i only try to use the Windows API code inside the Visual Basic6.0
in getting the computer name. where can i use Wimdows API, as a CLIENTS
SIDE or a SERVER SIDE?
Patrice wrote:
> 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
>
> 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.
>
>
> 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
> >
> > 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...
> > >