Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
inet
active_desktop
active_scrptng
asp.components
asp.db
asp.general
comctl32
comp.packaging
components.dev
dbweb
dhtml_editing
docobjects
html_authoring
html_objmodel
iis
iis.ftp
iis.security
iis.smtp_nntp
indexserver
misc
mshtml_hosting
scripting.jscript
scripting.vbscript
sdk_setup
shell_objmodel
urlmonikers
webbrowser_ctl
wininet
  
 
date: Wed, 26 Oct 2005 10:56:03 -0700,    group: microsoft.public.inetsdk.programming.scripting.vbscript        back       


API help   
Hi,

I'm new to VBScript, but not to VBA. I have the following code I use in VBA 
to return the USER ID and Domain information from the Active Directory. 
However, I have no idea where to put my api script on my web page. I know it 
must be placed somewhere in the header... Can someone help me with the 
Syntax? I need to capture the UserID and network domain name, and assign them 
to variables in order to determine what url will open for the user based on 
the data.

Many Thanks!

S. Skaar
DBA.
skaarwebconsulting@yahoo.com

Option Explicit
Private Declare Function apiGetComputerName Lib "kernel32" Alias _
    "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long 


Function fOSMachineName() As String
'Returns the computername
Dim lngLen As Long, lngx As Long
Dim strCompName As String
    lngLen = 16
    strCompName = String$(lngLen, 0)
    lngx = apiGetComputerName(strCompName, lngLen)
    If lngx <> 0 Then
        fOSMachineName = Left$(strCompName, lngLen)
    Else
        fOSMachineName = ""
    End If
End Function
date: Wed, 26 Oct 2005 10:56:03 -0700   author:   Sandy

Re: API help   
This cannot be done with vbscript. You will need to wrap this in an ActiveX
dll which can be instantiated from script.

Sandy wrote:
> Hi,
>
> I'm new to VBScript, but not to VBA. I have the following code I use
> in VBA to return the USER ID and Domain information from the Active
> Directory. However, I have no idea where to put my api script on my
> web page. I know it must be placed somewhere in the header... Can
> someone help me with the Syntax? I need to capture the UserID and
> network domain name, and assign them to variables in order to
> determine what url will open for the user based on the data.
>
> Many Thanks!
>
> S. Skaar
> DBA.
> skaarwebconsulting@yahoo.com
>
> Option Explicit
> Private Declare Function apiGetComputerName Lib "kernel32" Alias _
>     "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As
> Long
-- 
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
date: Wed, 26 Oct 2005 14:28:59 -0400   author:   Bob Barrows [MVP] com

Re: API help   
ahhh.. no wonder the problems I was having!!

do you have a good resource for creating an ActiveX dll?

Thanks again!

Sandy

"Bob Barrows [MVP]" wrote:

> This cannot be done with vbscript. You will need to wrap this in an ActiveX
> dll which can be instantiated from script.
> 
> Sandy wrote:
> > Hi,
> >
> > I'm new to VBScript, but not to VBA. I have the following code I use
> > in VBA to return the USER ID and Domain information from the Active
> > Directory. However, I have no idea where to put my api script on my
> > web page. I know it must be placed somewhere in the header... Can
> > someone help me with the Syntax? I need to capture the UserID and
> > network domain name, and assign them to variables in order to
> > determine what url will open for the user based on the data.
> >
> > Many Thanks!
> >
> > S. Skaar
> > DBA.
> > skaarwebconsulting@yahoo.com
> >
> > Option Explicit
> > Private Declare Function apiGetComputerName Lib "kernel32" Alias _
> >     "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As
> > Long
> -- 
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
> 
> 
>
date: Wed, 26 Oct 2005 11:36:07 -0700   author:   Sandy

Re: API help   
Start by getting VB5 or VB6. Then read the online help about creating
ActiveX objects.

Bob Barrows
PS. You can also use C++, but I figured since you have VBA experience ...

Sandy wrote:
> ahhh.. no wonder the problems I was having!!
>
> do you have a good resource for creating an ActiveX dll?
>
> Thanks again!
>
> Sandy
>
> "Bob Barrows [MVP]" wrote:
>
>> This cannot be done with vbscript. You will need to wrap this in an
>> ActiveX dll which can be instantiated from script.
>>
>> Sandy wrote:
>>> Hi,
>>>
>>> I'm new to VBScript, but not to VBA. I have the following code I use
>>> in VBA to return the USER ID and Domain information from the Active
>>> Directory. However, I have no idea where to put my api script on my
>>> web page. I know it must be placed somewhere in the header... Can
>>> someone help me with the Syntax? I need to capture the UserID and
>>> network domain name, and assign them to variables in order to
>>> determine what url will open for the user based on the data.
>>>
>>> Many Thanks!
>>>
>>> S. Skaar
>>> DBA.
>>> skaarwebconsulting@yahoo.com
>>>
>>> Option Explicit
>>> Private Declare Function apiGetComputerName Lib "kernel32" Alias _
>>>     "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As
>>> Long
>> --
>> Microsoft MVP -- ASP/ASP.NET
>> Please reply to the newsgroup. The email account listed in my From
>> header is my spam trap, so I don't check it very often. You will get
>> a quicker response by posting to the newsgroup.

-- 
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
date: Wed, 26 Oct 2005 15:30:59 -0400   author:   Bob Barrows [MVP] com

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us