I am working on Visual studio 2008 C# Windows application.
But I want to provide login for different user like purchase manager, admin, store manager, department user.
Can u help me in coding for creating this four different user’s login? and how to provide the password to admin.
My English is poor but I hope u understand this.
Plz help me..
You can build a simple screen which endows entitlements to user ids.
Entitlements can be screen wise with user ids assigned to them.
For e.g. one user can have access to store screens and another to the department.
Of course, only an admin can have access to the entitlement screen.
I'm using Dot Net 3.5 for performing tasks in parallel using below code but It's not showing expected performance i.e. if serial task takes 1 min then using multitasking/parallel tasking it will finish within 1 min or much less time but it takes same time.
// Initialize the reset events to keep track of completed threads
ManualResetEvent resetEvents = new ManualResetEvent[arrFileName.Count];
// Launch each method in it's own threadfor (int i = 0; i < arrFileName.Count; i++)
resetEvents[i] = new ManualResetEvent(false);
ThreadPool.QueueUserWorkItem(new WaitCallback((object index) =>
int actionIndex = (int)index;
// Execute the method
// Tell the calling thread that we're done
// Wait for all threads to execute
Threading is useful in situations when you want to perform tasks in the background e.g. process complex calculations while allowing the user to navigate across across web page.
Threading do not necessarily mean performance will be improved.
ThreadExcecute function is doing encryption of a files using third party dll. So depending upon file size it will vary the encryption time.But If I've run this in parallel for multiple files then definitely it suppose to take less time.
I require your opinion on what approach is good and/or practical for the following scenario.
There is a web application which queries data from SQL server.
Users report to a manager
1. The process by clicking a button is finding who reports to me (manager)
2. So there is a stored procedure written to find the users reporting to the manager
Now, there is a report (rdlc on the web server displayed via reportviewer control) which takes the manager as an input to generate report data for the staff members reporting to that manager.
The stored procedure for this report uses existing stored procedure (as in step 2 above) to find the staff members reporting to the manager and then generate required data.
My question is:
1. Is this the right way of doing this
2. Is there a need to develop a separate SQL view just for this report
3. What would be the best approach on doing this.
This always returns true, whether I have notepad open or not, can anyone tell me what I'm doing wrong?
Process current = Process.GetCurrentProcess();
foreach (Process process in Process.GetProcessesByName(current.ProcessName))
if (process.Id != current.Id)
static Mutex _m;
staticvoid Main(string Args)
// Try to open existing mutex.
// If exception occurred, there is no such mutex.
Program._m = new Mutex(true, "Notepad");
// Only one instance.returntrue;
// More than one instance.returnfalse;
What TYPE of exception is thrown? You may be having permission issues or something else... that is, the notepad exists and it's running, but you don't have permission to access it. If you look in the docs, there's 5 different exceptions it can throw, and the situations are very different...