473,396 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Can someone help me? (code here)

Hello gurus!
I wrote a code in VBS, that will check, that current user is in one from
three groups.
But i don't know how asimilate it with asp.net.
This page will be a bridge between 2 - main menu and report page.
Tomorrow to the 8 a.m. i must do this, but i don't know how.... Can someone
help me?
There are few messageboxes for help.
Here is my code (it's vbs):

Sub Main
Dim objUserName, objUserDomain, oGroup, objUser, gList, WshShell, sMessage,

sTitle
Dim objDomain, vDomain, vUserName
Dim objChangePwdTrue, objChangePwd, objUserProfile
Dim objPwdExpiresTrue, objFlags
Dim objAcctDisabled, intPwdExpired, objPwdExpiredTrue
Dim admin, manag, audit
admin = false
manag = false
audit = false
Set WshShell = WshShell.CreateObject("WScript.Shell")
vdomain = WshShell.ExpandEnvironmentStrings("%USERDOMAIN%")
vUserName = Request.ServerVariables("USERNAME")
'Request.ServerVariables("REMOTE_USER")

GetInfo ' sub routing to get user information
For Each oGroup In objUser.Groups
If gList = "" Then
gList = oGroup.Name
Else
gList = gList & ", " & oGroup.Name
End If
Next

for each oGroup in objUser.Groups
if oGroup.Name = "Administrators" Then
admin = true
msgbox(ogroup.Name)
Else
End if

if ogroup.name = "ManagReports" Then
manag = true
msgbox(ogroup.name)
Else
End if

if ogroup.name = "AuditReports" Then
audit = true
msgbox(ogroup.name)
Else
End if
Next
dim a
If admin = true then
set a = RSExecute("menugl.html")
'FRAME SRC="menugl.htmL" NAME="Podstawowa"
'<FRAMESET>'</FRAMESET>
End if

msgbox(admin & " " & manag & " " & audit)

if znaleziona then
else
End if
end sub
Sub GetInfo()
sMessage = "Please enter the domain to search." & vbCrLf & vbCrLf & _
"Default is: " & vDomain & vbCrLf & vbCrLf
sMessage = sMessage & "Hit Cancel or enter a blank to quit"
sTitle = "Domain to Search"

If vDomain = "" Then ' Cancelled by the user
' WScript.quit
End If

ssMessage = ""
ssTitle = ""

on error resume Next
sMessage = "Please enter the USER Login ID" & vbCrLf & vbCrLf & _
"Default is: " & vUserName & vbCrLf & vbCrLf
sMessage = sMessage & "Hit Cancel or enter a blank to quit"
sTitle = "USER Login ID"

If vUserName = "" Then ' Cancelled by the user
WScript.quit
End If

Set objUser = GetObject("WinNT://"& vDomain &"/"& vUserName & "",user)
If Err Then
msgNoUser = "Error: Could not bind to the following user: " &

vbCrLf _
& vbCrLf & "WinNT://" & vDomain &"/"& vUserName & vbCrLf &

vbCrLf _
& "Please verify your domain and user name and try again"
WshShell.Popup msgNoUser,0,"Error retrieving

information",vbCritical
GetInfo
Else
End If
End Sub

Function IsCScript()
If (InStr(UCase(WScript.FullName), "CSCRIPT") <> 0) Then
IsCScript = True
Else
IsCScript = False
End If
End Function
Nov 18 '05 #1
3 1505
I'm afraid it's not that easy, Marek. You're talking aobut 2 completely
different programming paradigms here. ASP is scripted and procedural.
ASP.Net is a fully-compiled programming technology which is object-oriented.

If your deadline is tomorrow morning, I believe you have 2 choices:

1. Stick with the ASP and make it work.
2. Look for another job.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Marek" <ma***@zegarek.pl> wrote in message
news:#s**************@TK2MSFTNGP15.phx.gbl...
Hello gurus!
I wrote a code in VBS, that will check, that current user is in one from
three groups.
But i don't know how asimilate it with asp.net.
This page will be a bridge between 2 - main menu and report page.
Tomorrow to the 8 a.m. i must do this, but i don't know how.... Can someone help me?
There are few messageboxes for help.
Here is my code (it's vbs):

Sub Main
Dim objUserName, objUserDomain, oGroup, objUser, gList, WshShell, sMessage,
sTitle
Dim objDomain, vDomain, vUserName
Dim objChangePwdTrue, objChangePwd, objUserProfile
Dim objPwdExpiresTrue, objFlags
Dim objAcctDisabled, intPwdExpired, objPwdExpiredTrue
Dim admin, manag, audit
admin = false
manag = false
audit = false
Set WshShell = WshShell.CreateObject("WScript.Shell")
vdomain = WshShell.ExpandEnvironmentStrings("%USERDOMAIN%")
vUserName = Request.ServerVariables("USERNAME")
'Request.ServerVariables("REMOTE_USER")

GetInfo ' sub routing to get user information
For Each oGroup In objUser.Groups
If gList = "" Then
gList = oGroup.Name
Else
gList = gList & ", " & oGroup.Name
End If
Next

for each oGroup in objUser.Groups
if oGroup.Name = "Administrators" Then
admin = true
msgbox(ogroup.Name)
Else
End if

if ogroup.name = "ManagReports" Then
manag = true
msgbox(ogroup.name)
Else
End if

if ogroup.name = "AuditReports" Then
audit = true
msgbox(ogroup.name)
Else
End if
Next
dim a
If admin = true then
set a = RSExecute("menugl.html")
'FRAME SRC="menugl.htmL" NAME="Podstawowa"
'<FRAMESET>'</FRAMESET>
End if

msgbox(admin & " " & manag & " " & audit)

if znaleziona then
else
End if
end sub
Sub GetInfo()
sMessage = "Please enter the domain to search." & vbCrLf & vbCrLf & _
"Default is: " & vDomain & vbCrLf & vbCrLf
sMessage = sMessage & "Hit Cancel or enter a blank to quit"
sTitle = "Domain to Search"

If vDomain = "" Then ' Cancelled by the user
' WScript.quit
End If

ssMessage = ""
ssTitle = ""

on error resume Next
sMessage = "Please enter the USER Login ID" & vbCrLf & vbCrLf & _
"Default is: " & vUserName & vbCrLf & vbCrLf
sMessage = sMessage & "Hit Cancel or enter a blank to quit"
sTitle = "USER Login ID"

If vUserName = "" Then ' Cancelled by the user
WScript.quit
End If

Set objUser = GetObject("WinNT://"& vDomain &"/"& vUserName & "",user)
If Err Then
msgNoUser = "Error: Could not bind to the following user: " &

vbCrLf _
& vbCrLf & "WinNT://" & vDomain &"/"& vUserName & vbCrLf &

vbCrLf _
& "Please verify your domain and user name and try again"
WshShell.Popup msgNoUser,0,"Error retrieving

information",vbCritical
GetInfo
Else
End If
End Sub

Function IsCScript()
If (InStr(UCase(WScript.FullName), "CSCRIPT") <> 0) Then
IsCScript = True
Else
IsCScript = False
End If
End Function

Nov 18 '05 #2
Ok :/
So, can you give me a link with walkthrought, that clearly shows how to
build it in asp.net?

Użytkownik "Kevin Spencer" <ks******@takempis.com> napisał w wiadomo¶ci
news:%2****************@TK2MSFTNGP09.phx.gbl...
I'm afraid it's not that easy, Marek. You're talking aobut 2 completely
different programming paradigms here. ASP is scripted and procedural.
ASP.Net is a fully-compiled programming technology which is
object-oriented.

If your deadline is tomorrow morning, I believe you have 2 choices:

1. Stick with the ASP and make it work.
2. Look for another job.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Marek" <ma***@zegarek.pl> wrote in message
news:#s**************@TK2MSFTNGP15.phx.gbl...
Hello gurus!
I wrote a code in VBS, that will check, that current user is in one from
three groups.
But i don't know how asimilate it with asp.net.
This page will be a bridge between 2 - main menu and report page.
Tomorrow to the 8 a.m. i must do this, but i don't know how.... Can

someone
help me?
There are few messageboxes for help.
Here is my code (it's vbs):

Sub Main
Dim objUserName, objUserDomain, oGroup, objUser, gList, WshShell,

sMessage,

sTitle
Dim objDomain, vDomain, vUserName
Dim objChangePwdTrue, objChangePwd, objUserProfile
Dim objPwdExpiresTrue, objFlags
Dim objAcctDisabled, intPwdExpired, objPwdExpiredTrue
Dim admin, manag, audit
admin = false
manag = false
audit = false
Set WshShell = WshShell.CreateObject("WScript.Shell")
vdomain = WshShell.ExpandEnvironmentStrings("%USERDOMAIN%")
vUserName = Request.ServerVariables("USERNAME")
'Request.ServerVariables("REMOTE_USER")

GetInfo ' sub routing to get user information
For Each oGroup In objUser.Groups
If gList = "" Then
gList = oGroup.Name
Else
gList = gList & ", " & oGroup.Name
End If
Next

for each oGroup in objUser.Groups
if oGroup.Name = "Administrators" Then
admin = true
msgbox(ogroup.Name)
Else
End if

if ogroup.name = "ManagReports" Then
manag = true
msgbox(ogroup.name)
Else
End if

if ogroup.name = "AuditReports" Then
audit = true
msgbox(ogroup.name)
Else
End if
Next
dim a
If admin = true then
set a = RSExecute("menugl.html")
'FRAME SRC="menugl.htmL" NAME="Podstawowa"
'<FRAMESET>'</FRAMESET>
End if

msgbox(admin & " " & manag & " " & audit)

if znaleziona then
else
End if
end sub
Sub GetInfo()
sMessage = "Please enter the domain to search." & vbCrLf & vbCrLf & _
"Default is: " & vDomain & vbCrLf & vbCrLf
sMessage = sMessage & "Hit Cancel or enter a blank to quit"
sTitle = "Domain to Search"

If vDomain = "" Then ' Cancelled by the user
' WScript.quit
End If

ssMessage = ""
ssTitle = ""

on error resume Next
sMessage = "Please enter the USER Login ID" & vbCrLf & vbCrLf & _
"Default is: " & vUserName & vbCrLf & vbCrLf
sMessage = sMessage & "Hit Cancel or enter a blank to quit"
sTitle = "USER Login ID"

If vUserName = "" Then ' Cancelled by the user
WScript.quit
End If

Set objUser = GetObject("WinNT://"& vDomain &"/"& vUserName & "",user)
If Err Then
msgNoUser = "Error: Could not bind to the following user: " &

vbCrLf _
& vbCrLf & "WinNT://" & vDomain &"/"& vUserName & vbCrLf &

vbCrLf _
& "Please verify your domain and user name and try again"
WshShell.Popup msgNoUser,0,"Error retrieving

information",vbCritical
GetInfo
Else
End If
End Sub

Function IsCScript()
If (InStr(UCase(WScript.FullName), "CSCRIPT") <> 0) Then
IsCScript = True
Else
IsCScript = False
End If
End Function


Nov 18 '05 #3
I'm afraid I can't. I can give you a link to a .Net SDK article that talks
about migrating from ASP to ASP.Net:

http://msdn.microsoft.com/asp.net/ge...e/default.aspx

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Leszek" <ma***@zegarek.pl> wrote in message
news:eG**************@TK2MSFTNGP09.phx.gbl...
Ok :/
So, can you give me a link with walkthrought, that clearly shows how to
build it in asp.net?

Użytkownik "Kevin Spencer" <ks******@takempis.com> napisał w wiadomo¶ci
news:%2****************@TK2MSFTNGP09.phx.gbl...
I'm afraid it's not that easy, Marek. You're talking aobut 2 completely
different programming paradigms here. ASP is scripted and procedural.
ASP.Net is a fully-compiled programming technology which is
object-oriented.

If your deadline is tomorrow morning, I believe you have 2 choices:

1. Stick with the ASP and make it work.
2. Look for another job.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Marek" <ma***@zegarek.pl> wrote in message
news:#s**************@TK2MSFTNGP15.phx.gbl...
Hello gurus!
I wrote a code in VBS, that will check, that current user is in one from three groups.
But i don't know how asimilate it with asp.net.
This page will be a bridge between 2 - main menu and report page.
Tomorrow to the 8 a.m. i must do this, but i don't know how.... Can

someone
help me?
There are few messageboxes for help.
Here is my code (it's vbs):

Sub Main
Dim objUserName, objUserDomain, oGroup, objUser, gList, WshShell,

sMessage,

sTitle
Dim objDomain, vDomain, vUserName
Dim objChangePwdTrue, objChangePwd, objUserProfile
Dim objPwdExpiresTrue, objFlags
Dim objAcctDisabled, intPwdExpired, objPwdExpiredTrue
Dim admin, manag, audit
admin = false
manag = false
audit = false
Set WshShell = WshShell.CreateObject("WScript.Shell")
vdomain = WshShell.ExpandEnvironmentStrings("%USERDOMAIN%")
vUserName = Request.ServerVariables("USERNAME")
'Request.ServerVariables("REMOTE_USER")

GetInfo ' sub routing to get user information
For Each oGroup In objUser.Groups
If gList = "" Then
gList = oGroup.Name
Else
gList = gList & ", " & oGroup.Name
End If
Next

for each oGroup in objUser.Groups
if oGroup.Name = "Administrators" Then
admin = true
msgbox(ogroup.Name)
Else
End if

if ogroup.name = "ManagReports" Then
manag = true
msgbox(ogroup.name)
Else
End if

if ogroup.name = "AuditReports" Then
audit = true
msgbox(ogroup.name)
Else
End if
Next
dim a
If admin = true then
set a = RSExecute("menugl.html")
'FRAME SRC="menugl.htmL" NAME="Podstawowa"
'<FRAMESET>'</FRAMESET>
End if

msgbox(admin & " " & manag & " " & audit)

if znaleziona then
else
End if
end sub
Sub GetInfo()
sMessage = "Please enter the domain to search." & vbCrLf & vbCrLf & _
"Default is: " & vDomain & vbCrLf & vbCrLf
sMessage = sMessage & "Hit Cancel or enter a blank to quit"
sTitle = "Domain to Search"

If vDomain = "" Then ' Cancelled by the user
' WScript.quit
End If

ssMessage = ""
ssTitle = ""

on error resume Next
sMessage = "Please enter the USER Login ID" & vbCrLf & vbCrLf & _
"Default is: " & vUserName & vbCrLf & vbCrLf
sMessage = sMessage & "Hit Cancel or enter a blank to quit"
sTitle = "USER Login ID"

If vUserName = "" Then ' Cancelled by the user
WScript.quit
End If

Set objUser = GetObject("WinNT://"& vDomain &"/"& vUserName & "",user)
If Err Then
msgNoUser = "Error: Could not bind to the following user: " &

vbCrLf _
& vbCrLf & "WinNT://" & vDomain &"/"& vUserName & vbCrLf &

vbCrLf _
& "Please verify your domain and user name and try again"
WshShell.Popup msgNoUser,0,"Error retrieving

information",vbCritical
GetInfo
Else
End If
End Sub

Function IsCScript()
If (InStr(UCase(WScript.FullName), "CSCRIPT") <> 0) Then
IsCScript = True
Else
IsCScript = False
End If
End Function



Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Sue | last post by:
Hello! I am back with another question. Remember I am a new JavaScript student and I am aware that this code does not check for all the possibilities and that as a "NEW" JavaScript student I am...
14
by: bo | last post by:
And why and where one should use one vs. the other? Verbally, it seems like semantics to me--but obviously there is some actual difference that makes references different and or preferable over...
9
by: TCMA | last post by:
I am looking for some tools to help me understand source code of a program written in C++ by someone else. Are there any non-commercial, open source C or C++ tools to reverse engineer C or C++...
6
by: Helmut Giese | last post by:
Hello out there, I am a rather experienced C programmer. However, today I got a javascript assignment because someone left (something like: "You're a great programmer - you'll handle this.") and I...
21
by: MLH | last post by:
A97 procedure to open http://www.arch.com/message/ enter an 800 number, press "Continue", enter a text msg string from a memo field and press "Send" This is a calendaring and appointment A97...
20
by: nicolas.riesch | last post by:
I try to understand strict aliasing rules that are in the C Standard. As gcc applies these rules by default, I just want to be sure to understand fully this issue. For questions (1), (2) and...
8
by: Joshua Moore | last post by:
/* Hi, I was hoping someone could help me with this problem. I did my work and worked my way through the usual compiler messages, but I have run against some problem I can't identify. The compiler...
4
by: Ron | last post by:
I am having a bit of problem with this code: Dim cmd As New OleDb.OleDbCommand("INSERT INTO help (Name, Email, telephone, description)VALUES('" & txtName.Text & "','" & txtEmail.Text & "','" &...
6
by: Dave Young | last post by:
I'm looking at some code that i've inherited and I'm not really familar with what's going on here and was hoping somone could explain it to me. For reference: f1 is a long f2 is a long ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.