473,698 Members | 2,632 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 objChangePwdTru e, objChangePwd, objUserProfile
Dim objPwdExpiresTr ue, objFlags
Dim objAcctDisabled , intPwdExpired, objPwdExpiredTr ue
Dim admin, manag, audit
admin = false
manag = false
audit = false
Set WshShell = WshShell.Create Object("WScript .Shell")
vdomain = WshShell.Expand EnvironmentStri ngs("%USERDOMAI N%")
vUserName = Request.ServerV ariables("USERN AME")
'Request.Server Variables("REMO TE_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.N ame)
Else
End if

if ogroup.name = "ManagRepor ts" Then
manag = true
msgbox(ogroup.n ame)
Else
End if

if ogroup.name = "AuditRepor ts" Then
audit = true
msgbox(ogroup.n ame)
Else
End if
Next
dim a
If admin = true then
set a = RSExecute("menu gl.html")
'FRAME SRC="menugl.htm L" NAME="Podstawow a"
'<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("WinN T://"& 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,"Er ror retrieving

information",vb Critical
GetInfo
Else
End If
End Sub

Function IsCScript()
If (InStr(UCase(WS cript.FullName) , "CSCRIPT") <> 0) Then
IsCScript = True
Else
IsCScript = False
End If
End Function
Nov 18 '05 #1
3 1528
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******** ******@TK2MSFTN GP15.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 objChangePwdTru e, objChangePwd, objUserProfile
Dim objPwdExpiresTr ue, objFlags
Dim objAcctDisabled , intPwdExpired, objPwdExpiredTr ue
Dim admin, manag, audit
admin = false
manag = false
audit = false
Set WshShell = WshShell.Create Object("WScript .Shell")
vdomain = WshShell.Expand EnvironmentStri ngs("%USERDOMAI N%")
vUserName = Request.ServerV ariables("USERN AME")
'Request.Server Variables("REMO TE_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.N ame)
Else
End if

if ogroup.name = "ManagRepor ts" Then
manag = true
msgbox(ogroup.n ame)
Else
End if

if ogroup.name = "AuditRepor ts" Then
audit = true
msgbox(ogroup.n ame)
Else
End if
Next
dim a
If admin = true then
set a = RSExecute("menu gl.html")
'FRAME SRC="menugl.htm L" NAME="Podstawow a"
'<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("WinN T://"& 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,"Er ror retrieving

information",vb Critical
GetInfo
Else
End If
End Sub

Function IsCScript()
If (InStr(UCase(WS cript.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******@takem pis.com> napisał w wiadomo¶ci
news:%2******** ********@TK2MSF TNGP09.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******** ******@TK2MSFTN GP15.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 objChangePwdTru e, objChangePwd, objUserProfile
Dim objPwdExpiresTr ue, objFlags
Dim objAcctDisabled , intPwdExpired, objPwdExpiredTr ue
Dim admin, manag, audit
admin = false
manag = false
audit = false
Set WshShell = WshShell.Create Object("WScript .Shell")
vdomain = WshShell.Expand EnvironmentStri ngs("%USERDOMAI N%")
vUserName = Request.ServerV ariables("USERN AME")
'Request.Server Variables("REMO TE_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.N ame)
Else
End if

if ogroup.name = "ManagRepor ts" Then
manag = true
msgbox(ogroup.n ame)
Else
End if

if ogroup.name = "AuditRepor ts" Then
audit = true
msgbox(ogroup.n ame)
Else
End if
Next
dim a
If admin = true then
set a = RSExecute("menu gl.html")
'FRAME SRC="menugl.htm L" NAME="Podstawow a"
'<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("WinN T://"& 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,"Er ror retrieving

information",vb Critical
GetInfo
Else
End If
End Sub

Function IsCScript()
If (InStr(UCase(WS cript.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******** ******@TK2MSFTN GP09.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******@takem pis.com> napisał w wiadomo¶ci
news:%2******** ********@TK2MSF TNGP09.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******** ******@TK2MSFTN GP15.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 objChangePwdTru e, objChangePwd, objUserProfile
Dim objPwdExpiresTr ue, objFlags
Dim objAcctDisabled , intPwdExpired, objPwdExpiredTr ue
Dim admin, manag, audit
admin = false
manag = false
audit = false
Set WshShell = WshShell.Create Object("WScript .Shell")
vdomain = WshShell.Expand EnvironmentStri ngs("%USERDOMAI N%")
vUserName = Request.ServerV ariables("USERN AME")
'Request.Server Variables("REMO TE_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.N ame)
Else
End if

if ogroup.name = "ManagRepor ts" Then
manag = true
msgbox(ogroup.n ame)
Else
End if

if ogroup.name = "AuditRepor ts" Then
audit = true
msgbox(ogroup.n ame)
Else
End if
Next
dim a
If admin = true then
set a = RSExecute("menu gl.html")
'FRAME SRC="menugl.htm L" NAME="Podstawow a"
'<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("WinN T://"& 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,"Er ror retrieving

information",vb Critical
GetInfo
Else
End If
End Sub

Function IsCScript()
If (InStr(UCase(WS cript.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
1970
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 not expected to check for everything. At any rate, the problem I am having with the following code is that it does not clear the fields once I press the SEND button. So can anyone here enlighten me as to what is causing the problem.
14
2533
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 pointers in some cases... TIA
9
4990
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++ programs with source codes on linux? i.e. It parses any sized C or C++ project to help reverse engineer, document, draw UML diagram and understand it and thus maintain it better.
6
1661
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 never have done any web stuff before. Oh, and it's due within 2 weeks of course :( Having had a first look at javascript I noted some familiarities with C, but there also seems to be a lot of pre-defined stuff (like 'document') with certain...
21
3497
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 database for an attorney's office. I'm sure it must be do-able. I know better than to mention the term "S__dK__ys" in conjunction with this topic. I've read enough in here to know that is extremely unreliable. Am sorry even that I have to use IE...
20
3754
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 (3), I think that the answers are all "yes", but I would be glad to have strong confirmation. About questions (4), (5) and (6), I really don't know. Please help ! ! !
8
1859
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 error message is unintelligable -- to me anyway. Anyway: Here is the code, maybe someone can tell me what is wrong with it. */ //buysome.cpp //Joshua Moore //the part responsible for the buying part of the farm pos simulation program
4
1484
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 & "','" & txtTelephone.Text & "','" & txtDescription.Text & "')", New OleDb.OleDbConnection(strconn)) at the end, strconn is underlined in blue and says not defined, I dont know what to do with this, how do I define it?
6
1212
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 here's the statement
0
8685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9171
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7743
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.