|
This is what I use passing in the DirectoryEntry object as a paramater.
public static bool CheckAccountDisabled(DirectoryEntry de)
{
int ACCOUNTDISABLE = 0x0002;
int flags = (int)de.Properties["userAccountControl"].Value;
if (((flags & ACCOUNTDISABLE) == ACCOUNTDISABLE))
{
return true;
}
return false;
}
modified on Thursday, June 25, 2009 6:02 PM
|
|
|
|
|
I've just started getting this for every breakpoint within a specific assembly.
"The breakpoint will not be hit, no symbols have been loaded for this document" I'm using a debug build, so what happened?
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Delete everything in your debug folder and clean your solution and rebuild, happens to me occasionally. This usually fixes it.
|
|
|
|
|
Not this time.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
You deleted your .pdb files as well? Close VS, delete pdb and binaries, open, clean solution and build.
Should solve it. Has to do with timestamps of builds not being updated, IIRC that info was held it the pdb files, deleting them, reopening VS with a clean solution / build solved it.
Give it another whack.
|
|
|
|
|
Yes.
I deleted the following folders with the solution closed:
<all projects="">\bin\debug\
<all projects="">\bin\release\
<all projects="">\obj\
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Sorry, that's what did it for me if I remember correctly. I can't remember if I deleted the .suo and .ncb files as well, but that might damage your solution and I don't want to corrupt your data.
|
|
|
|
|
I would do a rebuild all and see what happens.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Assuming you meant rebuild solution that didn't work.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Assuming you deleted all the files, that must mean that you're sure the exe you're running, is being build every time ?
I'd love to know what the root cause is, it sounds quite bloggable. ( http://thingsihateaboutmicrosoft.blogspot.com/[^] )
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
As as I can be without having the vista task managers option to find the path to the processes executable. I managed to fix it which is half way to the root cause...
I had two copies of the project on my start page. My normal build path, and a second leading to an second copy pulled from source control in a different location on my drive (a coworker had an odd issue after I checked something in and I wanted to make sure I didn't leave the source control with a version dependent on a non controlled file). I was opening the former, and all its bin\obj files were being rebuilt after deletion, but the problem went away when I deleted the bin/obj files from the second. Dunno any more about how it apparently managed to cross link something from the two copies.
My laptop LCD's borked and won't be replaced until today or tomorrow, but after that I can play around with this a bit at home if you've got any ideas on how to determine what the RC is.
We're using clearcase on this program (with the VS plugin) so it possible it is rational at fault not MS.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Make sure your startup project is referencing the correct version of the assembly (the one represented by the project in Visual Studio, as opposed to a specific external file.) It's possible that one of your projects is loading an older version of the assembly from some other path.
|
|
|
|
|
It's good now, but I didn't see your post until after I fixed the problem (see my last reply to CG).
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Hi
GetValue method (registrykey.getvalue()) dose not support REG_NONE keys.
how I get these values from c#?
|
|
|
|
|
Hi,
the .NET Registry classes still don't cover it all, one occasionally needs the original Win32 API functions, and P/Invoke to get to them. However I never needed any REG_NONE, are you sure you do, and it is worth it?
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Look here[^].
I don't think that they have yet updated this
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
I have a program that needs to do two-way communication with a serial port. Once I set up the serial port, I will do a WriteLine("something"), then the program must wait for a response, read the response, and then based on that response do another WriteLine, rinse and repeat. Ideally I want to be able to call some function match(SerialPort s, string matchText) that will block until I get a response from the SerialPort and then let me know if my text matches the response.
I've tried using ManualResetEvents and WaitOne(), but calling WaitOne() seems to block everything: the SerialPort.DataReceived event never triggers! Note that all the thread management is occurring in a static management class, but I don't believe this would cause the problem.
Any ideas? Perhaps I'm going about this the wrong way. It seems like the write->wait->read->decide->write... workflow should be a pretty common task with serial ports.
|
|
|
|
|
Hi,
there are at least two obvious ways to tackle this:
1.
fully event-driven: get things started from the main thread, then perform everything else inside some handler, in your case the SerialPort.DataReceived handler. So what it does is read the line that came in, interpret it, and react to it by performing another SerialPort.Write(), then return.
This is fine for simple cases, it may not suit when more complex interactions are required (e.g. imagine talking and listening to two peripherals, both connected serially)
2.
do not use events such as DataReceived, instead have a separate thread that performs all SerialPort operations, including synchronous (i.e. blocking) Reads. This gives you much more flexibility, you must however use the Control.Invoke pattern in order to touch GUI stuff.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
124256 wrote: SerialPort.DataReceived event never triggers
Did you remember to add an event handler for the DataReceived event? (serialPort.DataReceived += DataReceivedHandler)
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
Hey getting an exception with the following code
string Percentage = LastLine.Substring(LastLine.LastIndexOf("%") - 2, 2);
the string is a wgetlog , Im trying to get the two characters before % but the above code crashes the debugger
modified on Tuesday, June 23, 2009 2:40 PM
|
|
|
|
|
Hi,
No matter how many mistakes your code contains, it is unlikely to crash the debugger. You are probably getting a run-time exception, which provides you with all the information about what is going wrong and where. Since you are already in the debugger, try to have a look at the content of "LastLine", so do one of the following:
- output the content of LastLine prior to the offending line (e.g.use Console.WriteLine);
- hover over "LastLine" somewhere in that block of code;
- add "LastLine" to the watch window;
- set a breakpoint.
In short, debug your code.
Hint: sometimes index functions return -1.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Good answer, best hint. Have a 5, or a cookie. Second thought I'm hungry, cookie for me and 5 for you.
|
|
|
|
|
It seems it is actually crashing vhost.exe and the above dosnt stop it
The problem seems to be that there is no way to know how many constrictors before the start of the string .
for example
1% = -1
10% = -2
100% = -3
is there any way to modify the code to prevent this exception ?
|
|
|
|
|
Hi,
you never can trust your inputs, so your code should be defensive. The percent sign may be absent, the number of digits may vary, there might be spaces, etc.
if what you really want is the number which starts at the start of the string and ends just before the percent sign, just locate the percent sign (check for !=-1) and take the substring to the left of it hence LastLine.Substring(0, percentPosition) which you then can easily pass on to int.TryParse() or something similar.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|