|
The obvious place to start is the objectCategory . If you modify your second example to:
ds.Filter = String.Format("(&(objectCategory=person)(SAMAccountName={0}))", Me.tboxUserName.Text)
can you still find the missing user?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Tried your suggestion and the answer is YES, I could find the user with that criteria.
I'm using the following code in my "Ldap Dump" routine:
For Each sr As SearchResult In ds.FindAll()
I thought I read somewhere about getting LDAP information in "pages". Am I OK by using the above logic to extract the user list?
This is really a head scratcher.
|
|
|
|
|
David Mujica wrote: ds.Filter = "(&(objectCategory=person))" Sounds like a collection of "all persons".
David Mujica wrote: (SAMAccountName={0}) Sounds like a more specific collection; is there a person that's not a user? A disabled user?
http://www.ldapexplorer.com/en/manual/109050000-famous-filters.htm[^]
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
By combining the objectCategory=person and SAMAccountName={0} into one filter, I am capable of finding my user.
The problem seems to be that when I loop through the LDAP, I'm not getting all of the users.
|
|
|
|
|
Got it !
I added the following to my code and now the user in question is showing up in the "LDAP dump" file.
ds.PageSize = 2000
Thanks to all for replying to my post.
|
|
|
|
|
Thanks for posting the resolution.
Happiness will never come to those who fail to appreciate what they already have. -Anon
|
|
|
|
|
Howdie.
Has anyone encountered vb.Net reversing your edits to a project?
I just spent two days looking for a problem that took me so long to figure out because I had previously made some edits that I know were fixed, so I did not go back there until it was obvious the problem was there....Again! I had about 5 win32 functions that I needed to change from Private to Public, and a few ByRef that needed to be switched to ByVal. I was testing the program fine for a few days WITH THOSE FIXES ALREADY MADE, when all of a sudden I was getting odd errors that were hard to nail down":
"Cannot evaluate expression because the code of the current method is optimized."
and
"Exception of type 'System.ExecutionEngineException' was thrown."
The first error was difficult to nail down because it was silent and GetLastError() just returned 0 (function executed successfully), and the last error gives no indication of the problem source. Fortunately the last error went away with the solution to the first.
Basically what vb.Net did was change two of my Public back to Private, and switched one ByVal back to ByRef.
Very strange.
|
|
|
|
|
This may not be VB's fault at all, there are a couple things that could be going on...
First, if you had to do a disk repair or roll back (restore from an older version of the disk) then some disk changes may have been rolled back to old values. These roll backs can happen when you install software almost silently so its important to watch if the installer says "creating restore point".
Second, maybe you had the project open in two instances of visual studio, edited it in one, saved it, then in the other it usually says "the file changed would you like to reload" or something like that. If you don't read it quick then dismiss the dialog, make a change there and save it, it will overwrite your changes from the other instance.
Another thing is that you could have been editing the file in a sand box. Sometimes your anti-virus software incorrectly sandboxes some programs, you can make all the changes you want, compile, run, everything looks great until you exit the program and your changes aren't saved to disk. This is especially annoying and difficult to find, make sure that your antivirus hasn't sandboxed your Visual Studio instance.
Other than that, I really can't think of any reason that visual studio would "roll back" changes to your files, especially after saving them to disk.
|
|
|
|
|
Thanks for your reply, Ron.
There were no rollbacks, multiple instances open, or sandboxes running. But I have heard from somewhere along the line that some people have had a problem with making changes, and running it in the IDE and it behaving as if no changes had been made. I guess it boiled down to something involving the latest build vs. a cached build. One guy reported that even if he exited vb and came back in, the problem was still there, until he rebooted, and everything was OK. I could not reboot only because I am running a 3D rendering that must keep going.
My problem is different than those, but was wondering if they aren't related in some way.
|
|
|
|
|
Quote: But I have heard from somewhere along the line that some people have had a problem with making changes, and running it in the IDE and it behaving as if no changes had been made. That can happen when the source file somehow becomes post-dated in regards to your computer's time. Shutdown VS, fix the file date-time, delete the bin and obj folder contents.
How can this happen? Work on a project with someone on the other side of the world by exchanging files is how.
|
|
|
|
|
NOW I KNOW WHY THAT HAPPENS! Often, I will try to finish up a project development date-version by 12:00 midnight. I do that so that my dated project folders show up consecutively in Windows Explorer. I also put the date stamp in the project name, in case I wrote the date incorrectly and it does not match up with the Windows date stamp, or if I archive a folder much later than I should have (since Windows does not preserve the original modification date of the folder when it is copied). Just an extra layer of info to help keep things organized. But if I forget to close out by 12:00am and catch it within maybe half an hour, I will set my clock back to just before midnight of the previous day, save out, then copy that project folder over to a new one with a new date stamp in the title.
|
|
|
|
|
treddie wrote: Basically what vb.Net did was change two of my Public back to Private, and switched one ByVal back to ByRef.
Very strange. I'd rather call that "unlikely" than "strange". What reason would it have to do so?
Edit it again, and have it write it's version (or anything else you'd wanna use to discriminate between your current code, and the previous) to a file, or, better yet, using OutputDebugString. Weird, spooky stuff like this can happen if part of the code is outdated, which can happen through a multitude of ways.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I'll google "outdated code" and see what comes up. Another issue that might be related is for some reason a form will fail to refresh due to controls being "missing" when they were in fact always there. I find it odd that vb can lose track of controls on a form without me having made any edits that directly affect a control.
|
|
|
|
|
treddie wrote: I'll google "outdated code" and see what comes up. Ah, sarcasm, the most honest forms of poetry; Google for ..
Here[^]'s the link. In short, your app might pick another assembly than you expect it to, depending on the location of the assembly, it's version and some other stuff.
treddie wrote: Another issue that might be related is for some reason a form will fail to refresh due to controls being "missing" when they were in fact always there. I find it odd that vb can lose track of controls on a form without me having made any edits that directly affect a control. It didn't, otherwise it could not claim it to be missing. It knows what control is expected, but the complaint mentions that it did not find physical code there. Or anywhere else in it's search-path. Often, it's because it's either too picky (compiled against a specific version) or not picky enough (using an older version of the assembly that's higher in the searchpath).
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Heheh...No sarcasm intended. I don't expect people to feed me on a silver platter, so I was going to go search for it on my own.
I read the article, and that seems pretty messed up. I mean, If I'm writing a program, and I have my code sitting there, it should be the only code referenced. After all, I just spent the time to edit it...I expect it to be current without some shady things going on in the background.
As an update, I forgot to mention that the form was not refreshing IN THE IDE. I'm sure you've run into that, where you click on, say, the Form1.vb [design] tab, and instead of the form popping up with all its controls, you instead get an error screen telling you something bad happened and the form can't be displayed.
|
|
|
|
|
treddie wrote: I read the article, and that seems pretty messed up. It is
treddie wrote: As an update, I forgot to mention that the form was not refreshing IN THE IDE. The runtime still has to resolve the assembly, giving the same problems.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Ahhh, but of course. Unless the compiler has a magical fix.
|
|
|
|
|
No insult intended, but never underestimate the frustration caused by pilot error when using Undo.
|
|
|
|
|
No insult taken. You may be exactly dead on correct, there, in my case!
|
|
|
|
|
Hello,
using VB.Net and TAPI 3.x I created a little application to make and recieve calls. This application uses an ordinary telephone which is connected via USB to the computer.
Most functions seem to work fine, but there are some problems which I can't solve:
- If you take the telephone receiver off the phone and then make a call via my computer application Visual Basic reports an unknown error with the code 0x80040052.
- My application don't recognizes phone events and digit events!
It would be great if someone could help me. I studied nearly everything you can find about TAPI in the internet, nevertheless I don't know how to solve these problems.
Yours faithfully,
Steven
|
|
|
|
|
Hi everyone,
i am trying to write a simple code that reads a bitmap image, i.e ("c:\test.bmp"), then i would like to read every pixel and make a check if the pixel is wether a white or black pixel , to finally counting the number of black pixels in the image:
my code was like this :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim tst As New Bitmap("c:\tst.bmp")
PictureBox1.Image = tst
Dim x, y, bcnt As Integer
Dim c As Color = tst.GetPixel(x, y)
bcnt = 0
For y = 0 To tst.Height - 1
For x = 0 To tst.Width - 1
If tst.GetPixel(x, y) = Color.Black Then
bcnt = bcnt + 1
End If
Next
Next
MsgBox(bcnt)
End Sub
|
|
|
|
|
I'm not seeing a question in there.
You might want to search the articles for "Image processing for dummies". You'll find articles on how to go through the image data a LOT faster than GetPixel will.
|
|
|
|
|
thank u Dave, but i did not find any thing in articles. but i will do search on the internet about " LOT " function and how to use it.
any help will be appreciated.
thank u in advance.
|
|
|
|
|
sharief hussien VB wrote: but i did not find any thing in articles
I really have no idea what your question is. You never said what the problem is at all, so I'm guessing.
sharief hussien VB wrote: but i will do search on the internet about " LOT " function and how to use
it.
Read what I wrote again. There is no LOT function. I said the technique in those articles would be a lot FASTER than GetPixel.
|
|
|
|
|
sorry dave for my mysterious question, Lol
i would like to create a simple windows application that reads a bitmap image then counts the black pixels within the image, and finally print it out in a message.
i wrote the following code :
*****************************************
dim img as new bitmap ("c:\test.bmp")
dim x,y,count as integer
count = 0
for y = 0 to img.height-1
for x = 0 to img.width-1
if img.getpixel(x,y)= color.black then
count += 1
end if
next
next
mesgbox(count)
****************************************
the problem is that , the count is always 0.
why , ? i do not know?
is there any wrong with the code?
|
|
|
|