|
Read this and looked at the examples like this one below but all have the ("LDAP://Path") but this I don't know how to get via code. I know AD and how to find the path but the program I am writing is for users that do not.
If this if to hard to do without a knowledge of AD I will pull in the full domain or DNS sufix and build a string from it replaceing the "." with "DC=" but this is not the best way to do it am I was looking to see if there was code that would pull in the root AD DC=companyDC=comDC=au.
Below is am example from the link you sent me...
To search an Active Directory hierarchy
Create an instance of the DirectorySearcher object and initialize it to the DirectoryEntry value that you want to search. Create an instance of the SearcherResultsEntry object.
Set the Filter property of the DirectorySearcher object to the value that you want to search for.
Initialize the search by calling the FindAll method of the DirectorySearcher. The DirectorySearcher object will return a collection of all objects in the target directory whose values match those specified in its Filter property.
The following example searches a directory for the user name "John" and then iterates through the returned collection, writing each object's path to a console. Note that this example will not search subdirectories.
' Visual Basic
Dim entry As New DirectoryServices.DirectoryEntry("LDAP://Path")
Dim mySearcher As New System.DirectoryServices.DirectorySearcher(entry)
Dim result As System.DirectoryServices.SearchResult
mySearcher.Filter = ("(anr= John)")
For Each result In mySearcher.FindAll()
Console.WriteLine(result.GetDirectoryEntry().Path)
Next
When people make you see red, be thankful your not colour blind.
|
|
|
|
|
Memory leakage has been viewed when visiting Accsess Database through ADO under VB. When opening a Recordset with a large number of records,the amount of memory consumed by the VB application will rise up,as well as the "total memory-used" indicated by the "Task Manager" in its status bar. But when the VB application finishs using the Recordset and colse the Recordset,then set the variable to Nothing, the amount of memory consumed by the VB application will go down to its normal level gradually,while the "total memory-used" show by the "Task Manager" in its status bar will not decrease,even over a long time, untill the VB appliction exits,the "total memory-used" will suddenly decrease.
Then what causes such a problem? how to resolve it?
thank you.
qiyue
yue_qi_qi@sohu.com
2005-10-21
|
|
|
|
|
You're looking in the wrong place to see what memory is being used by your application. In Task Manager, you're seeing what memory has been RESERVED for the entire .NET Framework and it's virtual machine that runs your application, otherwise known as the CLR (Common Language Runtime). Some of this memory is not permanently allocated to your "application", but is reserved for future use. This means that if Windows wants some of that memory back, the .NET CLR Memory Manager will release whatever Windows wants back to the system.
The .NET CLR Memory Manager keeps the memory reserved for performance reasons. Since you've used a large chunk of memory before, you might need it again, so the Manager hangs on to it, even though your application hasn't allocated it again. Since it's a little time consuming to allocate memory from the system (adding it to the .NET managed memory heap), then allocate your managed object on that heap, the .NET Memory Manager will try to skip the first step, if at all possible, by reserving memory for future use.
If Windows needs the memory back for something else, the .NET CLR Memory Manager is more than happy to free up whatever Windows needs. If you want to see the real memory counters, open up Performance Monitor and use the memory counters under the .NET CLR Memory performance object.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all
I need to know how to write code when I press btn copy my application or my programme to spacIfic folder on the hard disk.
nobady answer last time are u
THANKS.
AMR-CIS
|
|
|
|
|
You're not very specific about what you mean by "copy my application". I'm assuming you just want to copy your .EXE and .DLL files. There's a very short example here[^] on how to copy a file.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
You're looking for <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsapplicationclassstartuppathtopic.asp" rel="nofollow">Application.StartupPath</a>[<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsapplicationclassstartuppathtopic.asp" target="_blank" rel="nofollow" title="New Window">^</a>] .
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
very thanks to u
this is what I want.............
AMR-CIS
|
|
|
|
|
with a datagrid in a winform
single click on the datagrid:
my program must do one think(change the color of a single cell) - OK
double click on in the datagrid:
the program must show a panel the content if the datable "under" the datagrid - OK
the datagrid class has 2 method datagrid1.doubleclick end datagrid1.click
well when i click two times (doubleclick method) the program executes one time the dobleclikc and two times the single click
*************************************************************************************
Private Sub DataGrid1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.MouseHover
Dim xxx As System.Windows.Forms.MouseEventArgs
Dim sss As Integer
sss = xxx.Clicks
If sss > 0 Then
If xxx.Clicks = 1 Then
'here code the inside datagri1.click
End If
If xxx.Clicks >2 Then
'here code the inside datagri1.doubleclick
End If
End If
End Sub
i take this exception
"System.NullReferenceException" in forfat1.exe
my question is:
how can i intercept the the single and the double click if mouse is over datagrid (mousehover method) bypassing commands datagrid.click end doubleclick end even mousedown????
thanks a lot and forgive my bad english
ROBERTO BAGGIO RULES
|
|
|
|
|
Hai Friends
I am trying to save data in excel file using vb6 code. I have to merge some cells in the excel sheet through the code. Problem is after saving the file excel.exe doesn't get closed in task manager.
Thanks and Regards
|
|
|
|
|
You need to explicitly close it; I assume your using automation to do the work?
So
objExcel.Close
objExcel = Nothing
DEBUGGING : Removing the needles from the haystack.
-- modified at 6:38 Tuesday 25th October, 2005
|
|
|
|
|
How to generate 3des encrypted data in Visual Basic?
|
|
|
|
|
Hi,
I developed a Client side proxy using sockets. And, I am able to get some sites without any problem.
But, I am facing problem in capturing data from few sites. Particularly Secured sites and whenever a website refers to another server (Location). I am getting HTTP/Other messages like:
1.
HTTP/1.1 302 Found
Date: Wed, 19 Oct 2005 12:40:32 GMT
Server: Apache/2
Location: http://news.com.com/
Content-Length: 204
Connection: close
Content-Type: text/html; charset=iso-8859-1
2.
"HTTP/1.0 403 Forbidden
Server: squid/2.5.STABLE1
Mime-Version: 1.0
Date: Thu, 06 Oct 2005 06:27:57 GMT
Content-Type: text/html
Content-Length: 1113
Expires: Thu, 06 Oct 2005 06:27:57 GMT
X-Squid-Error: ERR_ACCESS_DENIED 0
X-Cache: MISS from i.cnn.net
Proxy-Connection: keep-alive
3.
An existing connection was forcibly closed by the remote host
<b>Can anyone help me out in handling this problem</b>
Regards
Praveen
Praveen Bobbili
|
|
|
|
|
You posted this message in 2005 and I hope you solved your problem by now, if not I would have to see your code to be able to help you. There are lots of things involved in writing a good and stable proxy server. Listening on multiple threads and being able to catch streams are some of the main issues.
syedhashmi@gmail.com
|
|
|
|
|
plz tell me how to create a parent node and one clild node and then one more child node in vb .net in CODING.
thank you
Paritosh
|
|
|
|
|
Try this..
Dim tvNode As New TreeNode("Some Text")
tvNode.Nodes.Add("Some Text")
tvTreeViewName.Nodes.Add(tvNode)
Dan
|
|
|
|
|
hi..
i hav an application which send Fax Automatically.but whenever there are .HTM or.HTML attachments while sending fax it opens Fax-printer Dialouge box to select machine.i dont want to select this manually.what can i do for this..i m using fxcomexlib.dll to send fax.
|
|
|
|
|
how i direclty print form when we press f5.pls send the sample code.i want to not print data but i print form without going to ms-word
himanshu
|
|
|
|
|
Howdy!!
I've been working on a VB.net program to:
1. Rip data from a **Huge** Text file.
2. Encode that data to an XML URL
3. Pull the data from the XML from the website
4. Enter that data into an Access Database
Access 2002 to create reports from data.
Is there anyone out there that would be willing to help me optomize my program and database for performance and help me with error handling???
Right now it takes over a half hour to itterate through the .txt file (roughly 10,000 lines) and do its thing. My 'error handling' is me clicking OK on tons of errors... lol
Email me @ geoff at azpmc dot com if you'd like to help out a r00kie!
|
|
|
|
|
Oh yeah, this post was mine^^^^^^^
I just got arond to creating a log-in.
|
|
|
|
|
First question - why are you using XML ? Because it's coming through a web service ? If the files are huge, then wrapping them in XML tags won't do anything good. Secondly, how are you parsing the XML document ? You should use an XMLReader to provide a forward only reader, instead of XMLDocument, which will give you the DOM, at huge cost on a document of this size.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
The original text file is just a bunch of addresses. That part never sees XML.
Part one of the program takes the street number, st. name, city, state, zip and puts into a URL, calls the url as the source of the XML document. It then uses XMLtextReader to do this:
(the XML file is pretty small.... really small...why does this program chug so bad????)
Private Sub readXML(ByVal newURL As String, ByVal stnumber As Integer)
Dim anewURL As String = newURL
Dim reader As XmlTextReader = New XmlTextReader(anewURL)
Dim output As String
Dim name As String
Dim contents As String
Dim fName As String
Dim lName As String
Dim stName As String
Dim phoneNumber As String
Dim phone2 As String
Dim phone3 As String
Dim phone4 As String
Dim city As String
Dim state As String
Dim zip As Integer
Dim yesNo As String
Dim countYesNo As String
Dim contentInteger As Integer
reader.WhitespaceHandling = WhitespaceHandling.None
While reader.Read()
reader.MoveToContent()
If reader.NodeType = Xml.XmlNodeType.Element Then
name = reader.Name
contents = reader.ReadString()
reader.MoveToElement()
reader.MoveToFirstAttribute()
If name = "NAME" Then
reader.MoveToFirstAttribute()
contents = reader.ReadString()
fName = contents
End If
If name = "ADDRESS" Then
reader.MoveToFirstAttribute()
contents = reader.ReadString()
stnumber = contents
End If
Select Case name
Case "COUNT"
countYesNo = contents
Case "STATUS"
yesNo = contents
Case "LAST"
lName = contents
Case "STREET"
stName = contents
Case "CITY"
city = contents
Case "STATE"
state = contents
Case "ZIP"
zip = contents
Case "PHONE"
phoneNumber = contents
End Select
End If
End While
If yesNo = "OK" Then
addPhoneNumber(fName, lName, stnumber, stName, phoneNumber, city, state, zip)
End If
reader.Close()
End Sub
-- modified at 0:52 Friday 21st October, 2005
|
|
|
|
|
Does anyone out there think that there's a way to get this function to run faster?
|
|
|
|
|
vb_n00b wrote: I've been working on a VB.net program to:
1. Rip data from a **Huge** Text file.
2. Encode that data to an XML URL
3. Pull the data from the XML from the website
4. Enter that data into an Access Database
What format is the text file in? If it’s a comma separated file (or you can change the file format to a CSV) then adding this data to the access db is easy.
I have always wanted to try this, but never had a need for it.
Create a record set based on the CSV file, close the connection open a new connection to the access db. Attach the new connection to the record set and update it to the access db. Done, no extra data parsing needed, again never tried anything like this. If it works let me know…
Hope that helps.
DEBUGGING : Removing the needles from the haystack.
|
|
|
|
|
The text file contains a giant list of addresses and a bunch of other usless junk.
They look like this:
10/21/2005 9:12:34AM2331 WEST RIVER RDSearch Report
West Dennis, MA 02661
10/21/2005 9:12:34AM2331 WEST RIVER RDSearch Report
West Dennis, MA 02661
10/21/2005 9:12:34AM2331 WEST RIVER RDSearch Report
West Dennis, MA 02661
10/21/2005 9:12:34AM2331 WEST RIVER RDSearch Report
West Dennis, MA 02661
etc...
I have to parse the data from that to a URL something like this:
www.lookuptheaddress.com&stnum=2331&stName=West+river+rd&city=west+dennis...
That URL produces an XML page that I need to pull Name and Phone Number from and then slap into a database for later use...
i think what is bogging it down is the XML data parsing... Im going to re-work it using the XMLDocument methods and see if that helps any...
Thanks for the help and I welcome ANY input on this porject!!
_thanks again!
|
|
|
|