|
Folder and files can be pass word protected or encrypted only when you have NTFS (New Technology File System) formatting of your HDD. You can not do normally unider the FAT 32 file system in a Windows machine.
|
|
|
|
|
s buddy , but how to PASSWORD protect a folder in ntfs, can u plz tell that.
RaJ
|
|
|
|
|
Hi,
I am accessing Active Directory using LDAP.
When new user created and I try to connect through my web application I have to force him to change his password at first logon. This is set by admin and I am trapping it using active directory service Class and APIs.
But when I try to change this user's password, I am getting an exception in following code...
(results = mySearcher.FindAll() throws an exception when must change at first logon flag is true)
Can any body help me..mail me at dharmesh@freewavetech.com
MSN : dharmesh_gandhi@hotmail.com
-----Code ---------------------------------------
entry = New System.DirectoryServices.DirectoryEntry(strLDAP, strLogin, strOldPass)
mySearcher = New System.DirectoryServices.DirectorySearcher(entry)
mySearcher.Filter = "(&(objectClass=user)(samaccountname=" & strLogin & "))"
results = mySearcher.FindAll()
userEntry = results.Item(0).GetDirectoryEntry()
userEntry.Invoke("ChangePassword", New Object() {strOldPass, strNewPass})
userEntry.CommitChanges()
-----End of Code ---------------------------------------
Dharmesh.
|
|
|
|
|
After many tens of hours of searching Google, scanning programming groups, etc, I am almost about to give up. The only thing I have found is that there are (or at least has been) others struggling to find the answer to the same question as me, which makes me think that this is in fact something that is impossible, or at least difficult-, to do on Win32. So let me make some noice here and check if there are any kernel-mode expert that can help me out...
I am about to implement a C++ application (Larsen Commander - http://home.online.no/~leifel/lcmd/index.html) where I need to check (or get notified) when a thread or a process is waiting for data to be available at the read-end of my pipe. I am unable to find out how to do this using the standard Win32 SDK documentation. Anyone that can help?
My application acts as a GUI command line shell in this regard. It has a console monitor and a command line where the user can launch internal and extarnal commands in the same way as with CMD.EXE. Larsen Commander launches command line programs as child processes, and redirects the child's STDIN, STDOUT and STDERR streams in standard documented ways. Everything works just great, except when it comes to one thing: When the child process attempts to read data from its STDIN it enters a wait-state because its STDIN-stream is empty. What I want to do in my application then is to show the command line in a special color mode, so the user can type some text of which to write to the pipe that feeds the childs STDIN. However, I find no way to check if there is someone at the read-end of the pipe waiting for data.
Luckily (for my application and its users on Windows) most command line programs will never attempt to read anything from its STDIN, but some programs do. One example is UNZIP.EXE, which needs to get confirmations from the user (STDIN) e.g. before overwriting a file on the file system. UNZIP.EXE does this by reading from its STDIN.
To be clear: The only information I need in order for this to work is a way to check if there is someone waiting for data at the read-end of my pipe.
I am currently using an anonymous pipe created with Win32::CreatePipe(), but if I need to, and if it is possible, I can of course rewrite this to use a named pipe created with Win32:CreateNamedPipe(), or anything else. The best would be a way that is possible to work on all flavours of Win32, but it is also acceptible for me to use a technique only available on Win2000/XP.
Remember: My application is a GUI application. Thus, I cannot use any console-based technique for this, as far as I can see.
What I have tried are (code fragments only):
1) Using Win32::WaitForSingleObject() on the pipe file handle(s).
------------------------------------------------------------------
// This doesn't seem to work (res will never be WAIT_TIMEOUT):
HANDLE childStdInWriteSide = ...;
HANDLE childStdInReadSide = ...;
DWORD res = Win32::WaitForSingleObject(childStdInWriteSide, 0);
if (res == WAIT_TIMEOUT) // If child wait for data at read-end?
return true; // We never reach here!
else
return false;
// This doesn't work either (gives error "invalid handle"):
HANDLE childStdInWriteSide = ...;
HANDLE childStdInReadSide = ...;
DWORD res = Win32::WaitForSingleObject(childStdInReadSide, 0);
if (res == WAIT_TIMEOUT) // If child wait for data at read-end?
return true; // We never reach here!
else
return false;
2) Using Win32::NtQuerySystemInformation() to check the
state of the child process thread(s).
--------------------------------------------------------
// This doesn't work (child process thread wait state
// seems to be unstable).
LPVOID infoBuff = ...;
NtQuerySystemInformation(NT_PROCESSTHREAD_INFO, infoBuff, ...);
PSYSTEM_PROCESSES p = (PSYSTEM_PROCESSES) infoBuff;
for (;;)
{
if (p->ProcessId == myChildProcessInfo.dwProcessId)
{
// We have found the information for the child process of ours.
int threadCount = p->ThreadCount;
for (int i=0; i<threadCount; i++)
{
SYSTEM_THREADS* t = &p->Threads[i];
if (t->State == StateWait &&
(t->WaitReason == Executive ||
t->WaitReason == WrLpcReply))
{
// This happens also when the thread is not actually
// waiting on its STDIN, so I can't trust this.
return true;
}
}
// No need to test the remaining processes.
break;
}
if (p->NextEntryDelta <= 0)
break;
p = (PSYSTEM_PROCESSES)((char*) p + p->NextEntryDelta);
}
return false;
Thank you for reading all down to here. If you know I way to help me out of this problem I will be very, very happy.
What about having a registration code of Larsen Commander for free? - To the person that first provides a solution that actually works!
--
Leif Erik Larsen
Author of Larsen Commander
Download for Windows and OS/2 available at
http://home.online.no/~leifel/lcmd/index.html
|
|
|
|
|
Hello Leif;
Years of programming multi-threaded code have made me very sensitive to two particular values for timeouts in the WaitFor... functions. Those two values are 0 and INIFNITE.
I noticed that you used 0 in two of your test cases, and this is what MSDN says about 0:
If dwMilliseconds is zero, the function tests the object's state and returns immediately.
Now, I am not sure WHAT to expect if you are only testing for the object's state as opposed to, for example, putting in even a 1 millisecond wait and then looking for WAIT_TIMEOUT.
Typically, even if I want an 'immediate' timeout on a wait, I usually make it about 20 to 50 milliseconds for anything remotely related to USER interaction. If I get timeout, I assume nothing has happend or is really waiting and proceed with the processing.
I have never written code that uses either 0 or INIFNITE and I process the WAIT_TIMEOUT and WAIT_FAILED all the time. The code seems to work fine that way.
|
|
|
|
|
Giving a zero-timeout is well documented. It is used when you just want to check if the object is signaled or not.
Anyway, my code was just (a very stripped-) sample to show how I already has attempted to solve my problem. But I have given up this on Windows. It seems to be "impossible", so I have to rethink my application somewhat. Maybe providing the output console of each child in separate tabs, for instance.
--
Leif Erik Larsen
Author of Larsen Commander
Download for Windows and OS/2 available at
http://home.online.no/~leifel/lcmd/index.html
|
|
|
|
|
I'm trying to build a telnet login server which emulates the Win2k server, cept I'm making it a little more secure. I'm having a little trouble making the password obfusticate. I would prefer it to do what my RedHat login does, and not show what I'm typing in at the prompt, but I would settle for the *** that the Win2k server shows up... anyway, I'm the DragonLord, and I need some help... Cheers gentlemen (and rare ladies)
I wonder what happens if you open the fridge door before the light comes on?
|
|
|
|
|
Where can we download flash templates for free?
|
|
|
|
|
I am working on an object-oriented alternative library to C++ called the Object Oriented Template Library. It is designed to present a more abstract set of collections and primitives. A detailed description and preliminary documentation is available at http://www.cdiggins.com/ootl.html[^]. Let me know if you would be interested in seeing end up on codeproject.com once it matures somewhat.
Thanks all!
Christopher Diggins
http://www.heron-language.com
|
|
|
|
|
Hi Christopher
I, for one, would be very interested in seeing this library develop at CP (or any other place, for that matter). I've got a couple of questions:- Is there any draft source code we can have a look at?
- The preliminary docs are, well, sort of preliminary, so I couldn't grasp which are the intended benefits of OOTL as compared with STL (the lib is presented as an alternative to the latter.) If I'm understanding your rationale, I'd say OOTL collections work more or less like the STL with the important difference that they support interface-based polymorphism. Is this the key concept behind OOTL, or am I missing something?
Collections aside, I find the interface concept much intriguing. Reminds me of some dynamic type checking languages like Smalltalk, with some added compile-time checking in the spirit of C++. While I'd say this type of programming is not what C++ purports to support, maybe it can be useful for prototyping and some forms of RAD programming. Have you investigated how well interface programming interacts with GUI frameworks like MFC and WTL? While these frameworks are not polymorphic in the C++ sense of the word, it seems to me like commonality between different widgets (for instance, the SetWindowText/GetWindowText stuff) can be appropriately captured by suitable interfaces.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
|
|
|
|
|
Hello Joaquín,
I, for one, would be very interested in seeing this library develop at CP (or any other place, for that matter).
I am very pleased to hear that.
I've got a couple of questions: Is there any draft source code we can have a look at?
By tommorrow morning there will be, but I will have to warn you that making interfaces and design by contract work in C++ leads to some really complicated code.
If I'm understanding your rationale, I'd say OOTL collections work more or less like the STL with the important difference that they support interface-based polymorphism. Is this the key concept behind OOTL, or am I missing something?
This is essentially correct, though I consider the most important difference to be that the OOTL collections are arranged in a proper hierarchy, and are more like the abstract data types they represent. It may seem trivial, but the fact that the OOTL collections all use a common iterator type makes working with OOTL collections much easier and less cryptic.
Collections aside, I find the interface concept much intriguing. Reminds me of some dynamic type checking languages like Smalltalk, with some added compile-time checking in the spirit of C++. While I'd say this type of programming is not what C++ purports to support, maybe it can be useful for prototyping and some forms of RAD programming.
Most definitely but the applications extend to any kind of object-oriented design.
Have you investigated how well interface programming interacts with GUI frameworks like MFC and WTL?
Not yet, but this is a direction I would very much like to explore. There are no forseeable options to using interfaces with these kinds of libraries. It would be great to design a GUI library that could be adapted to work with different C++ GUI toolkits.
While these frameworks are not polymorphic in the C++ sense of the word, it seems to me like commonality between different widgets (for instance, the SetWindowText/GetWindowText stuff) can be appropriately captured by suitable interfaces.
Definitely.
Thanks again for your interest, and I will post to this thread as more news occurs. If you wish to follow or contribute development discussions, you can easily do so at http://groups-beta.google.com/group/ootl[^].
Christopher Diggins
http://www.cdiggins.com
http://www.heron-language.com
|
|
|
|
|
cdiggins wrote:
I will have to warn you that making interfaces and design by contract work in C++ leads to some really complicated code
The programmer shouldn't have to code them. You should provide classes or language constructs that can be translated by a pre-processor (much like C++ used to be translated into C in the early days; is that still the case?).
Just my two cents.
|
|
|
|
|
The OOTL documentation has been rewritten, and a first public release has been made of the code at http://www.ootl.org[^]
I am also currently working on an article for submission to codeproject.com.
Christopher Diggins
http://www.heron-language.com
|
|
|
|
|
I created a holiday Flash movie. Published it to html, htm & swf. I put the htm link into my signature slot in Outlook Express so I could put the movie at the end of my holiday greeting to my family.
I tested it by sending & receiving to myself through OE & Yahoo. The OE is fine with Yahoo the code is there, but nothing happens, plays, or even appears on the screen -- just the written text.
Any ideas on what code I need in the htm to cause Yahoo to play the swf when the email is opened?
I am stumbling blind in the dark on this one. I can't seem to find any references.
Thank you for any & all help.
Sharon: wtf:
|
|
|
|
|
how to import sql 2000 database to msde
|
|
|
|
|
Back up and restore!
Really, it is that easy. All you need is for your copy of EntManager to be able to see the MSDE server. Failing that you'll have to learn osql commands (I don't know any, sorry)
|
|
|
|
|
Do you mean that you want to talk to both servers at once, or just copy a database?
Normally you can use DTS for this...
Steve S
Developer for hire
|
|
|
|
|
how can i talk to both server at once and i have problem exporting data to msde through dts.tell me how i can do that
|
|
|
|
|
how can i talk to both server at once and i have problem exporting data to msde through dts.tell me how i can Solve that
|
|
|
|
|
What version of MSDE?
What *exactly* do you want to export from SQL2K into MSDE?
Is it a table, multiple tables, entire database, partial table?
Steve S
Developer for hire
|
|
|
|
|
It's done i have sucessfully imported data from SQL to MSDE.But i m having trouble packaging msde with .net framework and my .net aplication through PDW at the 3 step of msde Bootstrapper it show an error "invalid MSDE Files", even though i have put sql database files.
|
|
|
|
|
There are so many fabulous encrypting and hashing algorithms posted in CP , but strangely no Shred modules ?!I am sure lot of people are very much interested in knowing how data recovery is done and how various shredding methods ( Gutmann, DoD etc ) delete data beyond recovery...
Another trend with the authors about these subjects in CP seems to be write the code, write a few lines on how to implement it in your own project, and over.I mean, an inexperienced guy can only copy the authors code blindly, and use it in his project even though he doesn't have a wink of an idea as what he's doing.Won't it help if a bit more lines are devoted to technical discussions and the theory being implemented,apart from the application code?The authors can also post links to sites for further reading, this can let someone actually learn,rather then just copy.They are doing a great job no doubt , but I am a bit too curious at times i guess
Thanks,
_KANE_
"Some guys hack just to get themselves a girlfriend.What a pathetic reason huh ?"
|
|
|
|
|
how to filter http packet??
and store the data into a database??
Help Me !!
|
|
|
|
|
Hi!
I have developed a C# Control and I would like to share it because i've used a lot of things from this website and I would like to contribute publishing my work. How can I do it?
Thank you!
Jordi
"Catalonia is not Spain"
|
|
|
|
|
CP menu -> other stuf-> submit code[^]
plz don't forget to read (and follow) guidelines before writing/posting an article
best regards,
David 'DNH' Nohejl
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|