|
Sasidar
Here is the code from the function;
Private Function GetADUserGroups(ByVal userName As String) As String
Dim entry As New sys.DirectoryEntry("LDAP://WMU", username, Password)
Dim search As sys.DirectorySearcher = New sys.DirectorySearcher(entry)
search.Filter = "(&(objectClass=user)(objectCategory=person))"
'String.Format("(cn=*)", userName)
search.PropertiesToLoad.Add("memberOf")
Dim groupsList As System.Text.StringBuilder = New System.Text.StringBuilder
result = search.FindOne()
If Not result Is Nothing Then
Dim groupCount As Integer
groupCount = result.Properties.Count
Dim counter As Integer
For Each result In search.FindAll()
If result.Properties.Contains("memberOf") Then
groupsList.Append(result.Properties("memberOf")(0))
groupsList.Append(NewLine)
End If
Next
End If
groupsList.Length -= 1 'remove the last "|" symbol
Return groupsList.ToString()
End Function
Bis
-- modified at 4:30 Thursday 15th June, 2006
|
|
|
|
|
Hi there,
Example
Public sub add(byval a as interger, byval c as interger)
a=10
b=20
sum =a+b
end sub
if someone uses this sub then he should get the sum value also , like
retur=add(10,20,sum)
"S" should get the result.
something like this.
can any one please help
bharath.s
|
|
|
|
|
You add the parameter as ByRef instead as ByVal. ByVal passes tha parameter as a copy of the input value. ByRef passes the object reference i.e. you are modifying the exactly same object/variable.
Public Sub add(ByVal a As Integer, ByVal b As Integer, ByRef sum As Integer)<br />
a = 10<br />
b = 20<br />
sum = a + b<br />
End Sub
|
|
|
|
|
I think you really want a Function
Example :-
Public Function add(ByVal a as integer, byVal b as integer) as integer<br />
Return a+b<br />
End Function<br />
Use it like so...
<br />
sum=add(10,20)<br />
Steve Jowett
|
|
|
|
|
i am using this scanner in web based application for a single scnnaer multipul client will we connected but how
i will scan the image and store into the server
plz help me if possible with source code
Mm
|
|
|
|
|
Hi,
I have an Main.vb(MDI container) form as a parent in that im loading another form Launch.vb in the page load of main.vb. In the button click ok launch.vb form i should display a form called change.vb.
So in the button click event of launch.vb form i have created an instance of the change.vb form and im showing the form. But when i assigned the top and left of the form its not taking.
If i assign the CAEditor.MDIParent = Me, its giving error, because Launch is not an MDI Container.
The code written in the Launch.vb form button click event. Its working fine but the top and left locations are not taking. and its showing the form in different location.
Dim CAEditor As New frmChange
CAEditor.ShowInTaskbar = False
''''''''CAEditor.MDIParent = Me
CAEditor.Left = 310
CAEditor.Top = 82
CAEditor.ShowDialog(Me)
How i can assign the location of Change.vb the form in the button click of Launch.vb. If i specify the location in the page load of Change.vb its working fine, but i need to specify in the click event of launch.vb.
Please any one help me out to solve this problem, thanks in advance.
Regards
Mukil.
|
|
|
|
|
Setup properties on the Change.vb form for Left and Top. Pass the values from the calling form to the Change.vb before you open the Change.vb form. Then in the load event from the Change.vb form set the left and top based on the sent values.
|
|
|
|
|
Thanks for your reply. i will check it
Mukilan.
|
|
|
|
|
I mean ,is it suppose to be taken From PictureBox!
Dou you Guys Know Any website provide Picture icon bitmap or any other Graphic For Making GAme In VB.net!
Please HelpMe!!!!!
|
|
|
|
|
Hello all,
I have just got this new HP Compaq nx6125 laptop which has a finger scanner which helps me to log into the computer. I was just thinking does anyone know how we can program the finger scanner to reconize the finger. In short how to i learn finger scanning programming...
I know its very hard... but if any one has any code or any directly i would really appreciate it a lot..
CH
|
|
|
|
|
hi
how could i use this code
Private Type RGBTRIPLE
rgbtBlue As Byte
rgbtGreen As Byte
rgbtRed As Byte
End Type
to get every pixel in bitmap file (Bmp) with the format RGB
thx
Dodo
DODO
|
|
|
|
|
In C#, you could use an unsafe block to iterate over the image and store the values ( as in my image processing articles on this site ), but in VB.NET you'd have to do it the slow way. If you want any sort of performance, write this bit in C# using my code as a guide and use it from a dll.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I'm using vb.net.How i want to create folder for the files that i have copied from other URL source.
I want the folder name generate a date.So the folder name shown the date its created.
Can i do that in VB.net?
I'm using .ini file to get the files source and the destination for the copied files.
.ini file:-
[source]=http://www.abc.com
[locadir]=\\local disk\c$\input
[filename]=abc.ops,nice.txt
Cute Gurlz
|
|
|
|
|
Has anyone successfully created a DataGrid within a DataGrid using VB.Net??
(The Parent Datagrid has the topics and when the row is selected, opens directly below with the other datagrid containing books of that topic.)
Erin
|
|
|
|
|
is it possible to set the root folder that is displayed in the FolderBrowserDialog? The FolderBrowserDialog rootfolder property is a constant and for the local system. I want a dialog where I can set its root folder to be a remote machine where the user is limited to the root and sub items.
thanks
glenn
|
|
|
|
|
Dear All,
Would you please tell me how to display second line if the first line in text file is meet the condition. I am using VB.NET.
I would appreciate your helps very much,
|
|
|
|
|
You open the file, read the first line compare it to the condition, if it passses then you display the second line.
What part is giving you problems?
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Dear CWIZO,
Here is my code below, with this code, I can read how many lines that met the condition, but I can not read the second line. Can you help me out. I would appreciate your potential helps very much,
<br />
Private Sub BtnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSend.Click<br />
Dim Start As String = "Start"<br />
Dim intTotalCount As Integer<br />
intTotalCount = CountStringInFile(strFile, Start) <--HERE, I CAN READ HOW MANY LINE MET THE CONDITION<br />
end Sub<br />
<br />
Private Function CountStringInFile(ByVal FilePath As String, ByVal StringToLookFor As String) As Integer<br />
Dim strContent As String = ""<br />
<br />
'Get a StreamReaderclass that can be used to read the file <br />
Dim objStreamReader As StreamReader<br />
<br />
Dim intCount As Integer<br />
Dim intCountahead As Integer = 1<br />
<br />
objStreamReader = File.OpenText(FilePath)<br />
<br />
While objStreamReader.Peek <> -1<br />
<br />
strContent = objStreamReader.ReadLine<br />
intCount += CountLineByLine(strContent, StringToLookFor)<br />
End While<br />
<br />
'Close the stream <br />
objStreamReader.Close()<br />
<br />
objStreamReader = Nothing<br />
<br />
Return intCount<br />
<br />
End Function<br />
<br />
Private Function CountLineByLine(ByVal vstr As String, ByVal strToSearch As String) As Integer<br />
Dim intIndex As Integer<br />
<br />
Dim intCount As Integer = 0<br />
<br />
intIndex = InStr(vstr, strToSearch)<br />
<br />
While intIndex > 0<br />
<br />
intCount += 1<br />
<br />
intIndex = InStr(intIndex + 1, vstr, strToSearch)<br />
<br />
End While<br />
<br />
Return intCount<br />
<br />
End Function<br />
|
|
|
|
|
Please how do I access and manipulate the value input into a textbox I created at runtime. the code is shown below. When i run it an error "object reference not set to an instance of an object" is shown
Dim x As Integer, b As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim y As New System.Drawing.Point(8, 48)
If (IsNumeric(txtdata_num.Text)) Then
x = CInt(txtdata_num.Text)
Try
For b = 0 To x - 1
Dim st(b) As System.Windows.Forms.TextBox
st(b) = New System.Windows.Forms.TextBox()
st(b).Location = y
st(b).Name = "textbox" & b
st(b).Size = New System.Drawing.Size(40, 40)
st(b).Visible = True
Me.Controls.Add(st(b))
y = New System.Drawing.Point(st(b).Location.X + st(b).Size.Width, st(b).Location.Y)
If (b + 1) Mod 10 = 0 Then
y = New System.Drawing.Point(st(0).Location.X, st(b).Location.Y + st(b).Size.Width + 5)
Else
End If
Next
Catch ea As Exception
MsgBox(ea.Message)
End Try
End If
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
For b = 0 To x - 1
st(b) = New System.Windows.Forms.TextBox()
'Dim st(b) As System.Windows.Forms.TextBox
If st(b).Text <> "" And IsNumeric(st(b).Text) Then
Dim ad As Integer
ad = Val(st(b).Text) + Val(st(b + 1).Text)
MsgBox(ad)
End If
Next
End Sub
Fikunmi Feyijin
Hicad Systems
Nigeria
|
|
|
|
|
You have to loop through the controls on the form (or container control) to find the one you want.
For example:
Dim ad As Integer = 0
Dim objControl As Object
For Each objControl In Me.Controls
If TypeOf objControl Is TextBox Then
If objcontrol.Text <> "" And IsNumeric(objcontrol.Text) Then
ad += Val(objcontrol.Text)
MsgBox(ad)
End If
End If
Next
|
|
|
|
|
Thanks the code worked. But I want to get the properties of any of the textboxes at random and access them with the name I created for them at runtime.
Dim ad As Integer = 0
Dim objControl As Object
For Each objControl In Me.Controls
If TypeOf objControl Is TextBox Then
If objcontrol.Text <> "" And IsNumeric(objcontrol.Text) Then
ad += Val(objcontrol.Text)
MsgBox(ad)
End If
End If
Next
Fikunmi Feyijin
Hicad Systems
Nigeria
|
|
|
|
|
I would use the Tag property to set some unique key that you can use to reference the text box while looping through to know when you have got the right one.
|
|
|
|
|
i'm using a SQL Server 2000.
now want i want is to make one of the machine on my local network
Machine one: i've installed the SQL Server 2000 with these settings
1) Use Local System
2) MixMode (Use Windows Authentication and SQL Server Authentication)
USER ID = sa
Password = sa
From Machine tow which has the program: the connection string is:
<<< Me.SQLConnection_Search.ConnectionString = "packet size=4096;integrated security=SSPI; Persist Security Info=true; data source= "the name of the instance on Machine ONE"; user id=sa; password=sa; initial catalog=DBNEW; Server="Machine One Name">>>>>>>
when i connect --> "connect faild to MachineOne\Guest"
when i changed the SERVER to SERVER = "Machine One Name\User Account of the windows"
this message appear : "SQL Server does not exist or access is denied"
So what can i do.??????
Faris Madi
Nothing Comes Easy (N.C.E.)
|
|
|
|
|
I'm not sure what your doing but the way I connect to local database is:
Dim cn As SqlConnection = New SqlConnection("workstation id=yourcomputername;packet size=4096;integrated security=SSPI;data source=yourcomputername;persist security info=False;initial catalog=yourdatabasename")
|
|
|
|
|
Hi
I need to show the context menu (right click menu) of a file/folder. I have a dll (written in C) which takes the address and a location and displays the context menu of the specified file/folder in the specified location in the screen. The dll is sure using API calls. I would like to have the code in vb6. I'd be glad if someone could let me know what API's and how...
Thanks in advance
|
|
|
|