|
When you are authenticating the user, at that point of time you should check the role the user belongs to. Once you get the role, enable/disable the controls. As far as enabling disable of the controls based on the business rules goes, that would happen on some user action after he logs in. So that would not interfere.
Here[^] is another article that might be useful.
|
|
|
|
|
This might get you started:
User Login For WinForm Applications[^]
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
I want know how to keep records of copied files to an external disk,such as USB? does anyone know how to achieve this in coding? Which kind of API s can we used to do this?
|
|
|
|
|
you could use log4net and log either to a file or a database everytime you do a copy ...
is that the sort of thing you mean ?
'g'
|
|
|
|
|
petta1000 wrote: I want know how to keep records of copied files to an external disk,such as USB?
There's no filter or event that fires for all copy-actions.
Do you want to log copy-actions initiated by your own application? If so, you'd need to write a message yourself.
Do you want to keep an eye on a folder on that external drive? A FileSystemWatcher perhaps?
Can you explain in more detail what it is that you're trying to achieve?
I are Troll
|
|
|
|
|
I want to keep and eye on all the files that are copying to a USB media. Whenever file copy operation perform, I want to check whether those are copying a USB device or not. If they are copying to a USB device, details of those file transfers should be logged.
|
|
|
|
|
petta1000 wrote: I want to keep and eye on all the files that are copying to a USB media.
Might be doable using a CopyHook[^].
I are Troll
|
|
|
|
|
Hi,
You have to write a service which will motinor USB drive. If any USB is connected to the system than watch that USB using FileWatcher class.
Regards,
Sunil G.
|
|
|
|
|
I think you are right. But is there any examples how to achieve this. And I'm not that much sure whether I can do this for file copy event using FileSystemWatcher.
|
|
|
|
|
I apologize if this post is generic and redundant, but I have not found a solution, but I have been searching the net for a good example with no luck....
I have a simple windows form app that has a windows media control, and I want to play a playlist. I have a directory that has a list of playlists and I want to select a playlist and play it.
I have all the code to select the playlist working, but I can not for the life of me figure how to set the active playlist in the control and then make it play...
Any links or direction to a place find a sample would be greatly appreciated.
|
|
|
|
|
I have to agree that information on this does seem hard to come by.
For all comments that follow I am assuming that you are talking about the WindowsMediaPlayer ActiveX control, although your question does not make it clear. If it is not this control, please let me know to save me wasting my time.
However after about 10 minutes Googling I have discovered that there is a currentPlaylist property, so far, however I am unable to determine how to start playing.
Unless you tell me that it is not WMP control I will continue investigating.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I have just found this[^] thread which contains
this.axWindowsMediaPlayer1.Stop();
so maybe there is a
this.axWindowsMediaPlayer1.Start();
method? Give it a try, the worst that can happen is that your computer will explode!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
OK, here is the full gen.
Go to Solution explorer.
Open the references folder.
Find the reference to the DLL you are using and right-click on it.
From the context menu select 'View in Object Explorer'.
In the left-hand pane of the Object Explorer scroll down to and select WindowsMediaPlayerClass.
In the top right-hand pane you will see all of the available members.
You will see that there is a Play method, it would seem to be what you are looking for.
Whilst you are there, have a good look through the list, there are lots of useful looking methods/properties.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi, Thanks for the replies, all of them, good info and was helpful.. I am working on it now.
I am sorry I did not post the control, but yes your assumption is correct I am using the windows media player control.
I will post with the end result, and a code snippet in case helps others, thanks for the pointers.
|
|
|
|
|
I want to display four images from a folder in local hard drive. the latest four images should display in the form.
how do I get the latest images to display in for picture boxes?
Thank You..
|
|
|
|
|
|
hi all
i want to have an event loger in my project
at first i want some sample codes to customize them to fit in my project
and at second i want to get some idea about it`s graphical interface and ...
plase show me some samples
windows form app
no wpf
thanks in advance
|
|
|
|
|
Hi,
this recent article[^] presents a simple way to log information; it does not rely on Windows Event Viewer stuff though.
CodeProject hosts a number of articles dealing with Windows Events and Event Viewer, here[^] is just one of them.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
hello
thanks
good answer
but give me some more please!
|
|
|
|
|
|
You have System.Diagnostics.Trace and log4net framework.Just google and will find plenty of articles & tutorials how to use them.
Life is a stage and we are all actors!
|
|
|
|
|
hello dear hristo bojilov
i want to have my own logger application !
witch could save and retrive my own data
the case is having a sample log application to get it`s adiea or customize that app for my own intention
|
|
|
|
|
Hello everyone,
I have a bitmap object that is created in C# and I want to share this bitmap between managed and unmanaged code.
So, I have something as follows in my C# code:
void DrawGraphic()
{
BitmapData bitmapData = myBitmap.LockBits(new Rectangle(0, 0, Width, Height), ImageLockMode.ReadWrite,
PixelFormat.Format32bppArgb);
}
Is there a possibility to pass the BitmapData pointer to my unmanaged code and then use the result? So, I do not want to create a copy but somehow share this bitmap data.
Thanks for any help you can give me.
Thanks,
Keith
|
|
|
|
|
GCHandle[^] may be what you're looking for...
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
There is no need for GCHandle . Basically passing an image is very similar to passing an array, however bitmapData.Scan0 is an IntPtr which you can pass straight to a native function that expects a pointer, say int* or char* . You should be aware of the number of bytes per pixel, their order, and the stride (the distance in pixels between consecutive rows could be larger than the image width). And you should not natively abuse the pointer by writing outside the bmpData area of course.
I don't have a bitmap example handy, I can offer two articles on passing arrays though:
- http://www.perceler.com/articles1.php?art=marshalarrays1[^]
- http://www.perceler.com/articles1.php?art=pinvoke1[^]
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|