.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

Lock the PC

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :.NET Framework
 

Hi,

I am developing an internet cafe software using C# and I want to know how can I Lock the PC from the server or based on a time.. but basically I want the whole screen to be covered by a form and user can't do anything in the PC unless the form is gone by whatever way I define.

 

Thanks,

Jassim


Jassim Rahma


View Complete Post


More Related Resource Links

Concurrent Affairs: Build a Richer Thread Synchronization Lock

  

In my last column, I showed the various thread synchronization mechanisms employed by the Microsoft® . NET Framework (see Concurrent Affairs: Performance-Conscious Thread Synchronization). I then examined the performance characteristics of all these mechanisms and determined that the Interlocked methods performed the best because the calling thread never has to transition to kernel mode.

Jeffrey Richter

MSDN Magazine March 2006


Memory Models: Understand the Impact of Low-Lock Techniques in Multithreaded Apps

  

Because the use of low-lock techniques in your application significantly increases the likelihood of introducing hard-to-find bugs, it is best to use them only when absolutely necessary. Here Vance Morrison demonstrates the limitations and subtleties low-lock techniques so that if you are forced to use them you have a better chance of using them correctly.

Vance Morrison

MSDN Magazine October 2005


C++ Q&A: Performance Monitoring, Managed Extensions, and Lock Toolbars

  

In the June 2004 issue of MSDN®Magazine, I described a class called ShowTime that you can use to do simple performance monitoring for your app. ShowTime uses its constructor/destructor to record the start/stop times of its existence so you can instantiate it in a block of code like so: { ShowTime st(_T("Total time is:")); // some lengthy operation } .

Paul DiLascia

MSDN Magazine September 2004


Lock the window size to uniform in wpf

  
I have a window that contain a ViewBox. The ViewBox's Streach property is set to Uniform. And I want to set the window size to be uniform! that means the Height And Width properties are relative to each other.

ThreadPool with lock isn't thread safe

  
Hello, I'm having some problems with my code which apparently isn't thread safe at all. The problem is that it doesn't crash often, but of course it does when in production! I have twisted my mind around the problem for a month or so now, and I need some help in sorting out the problem. Well, the problem is that it isn't thread safe, and the collection (_subscribers) is modified while looping. The error says that it crashes in the method: SendRoundSettings. Here's part of the code (which I guess contains the error, as the other methods are pretty much identical): [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple)] public class DuplexService : IDuplexService { private readonly object _syncRoot = new object(); private static Subscribers _subscribers = new Subscribers(); private static RoundSettings _currentRoundSettings = new RoundSettings() {CompetitionId = 1, NumberOfAthletesInRound = 0, Round = 0, SortDirection = SortDirection.ByStartNumber}; public void SendJudgeScore(CompetitionJudgeAthleteJump judgeScore) { ThreadPool.QueueUserWorkItem(state => { Subscribers clonedSubscribers = CloneSubscribers(); Console.WriteLine("Sending judgeScore to {0} client(s)", clonedSubscribers.Count(x => x.CompetitionId == judgeScore.CompetitionId));

How to lock tables during a transaction

  
Hi, is there a way do something like this:  BEGIN TRANSACTION --lock table1 --do work here --unlock table1 COMMIT TRANSACTION

Why does RowLock result in a Page Lock

  
Hi, I am having a problem where even though I have indicated a rowlock it results in a page lock and a subsequent process is unable to access the table till the first process has commited.   Sample code is below.   Process 1 Begin Transaction SELECT EmpName FROM fEmployee WITH (ROWLOCK) WHERE EmpNo = 1 PRINT fEmployee.EmpName -- will print 'Sam' UPDATE fEmployee SET EmpName = 'Bob'  WHERE EmpNo = 1 .... .... .... Lots of other related processing takes place here and then finally COMMIT TRANSACTION Process 2 Begin Transaction SELECT EmpName FROM fEmployee WITH (ROWLOCK) WHERE EmpNo = 2 PRINT fEmployee.EmpName -- will print 'Rick' UPDATE fEmployee SET EmpName = 'Paul'  WHERE EmpNo = 2 .... .... .... Lots of other related processing takes place here and then finally COMMIT TRANSACTION When I run process 1 and process 2 at the same time, till process 1 commits the transaction, process 2 does not perform the Select and print the name. Why is this the case as they are both selecting different records and the Select has specifically indicated a RowLock. What I noticed was that when the rows are in the same page this problem occurs, while if the records are in different pages (assuming the data is large in the table and the gap between the empno's are large) it does not occur. Any help appreciated. Thanks

Cannot lock request 254,023

  
Hi, I have been running SSIS job for loading 26 million records from SAP source to SQL Server table having 20 columns. there are no transformations in my DFT. after DFT i have Execute SQL Task to get the target count. 26 million records have been successfully inserted into the table but job failed with below error:"Source: DFT_BW_TO_STAGING SAP BI Source     Description: Cannot lock request 254,023  End Error  DTExec: The package execution returned DTSER_FAILURE (1)." What could be the reason behind this result. Any help would be greatly appreciated.Das

Lock statistics

  
Hope this is the correct forum. I know you can collect real-time information about locks. But are there any historical data that can be fetched per database?

Lock statistics

  
Hope this is the correct forum. I know you can collect real-time information about locks. But are there any historical data that can be fetched per database?

Sharepoint sub site lock

  
How to lock Sharepoint 2007 sub site.I used stsatm-o setsitelock it locks site collection. I want to lock only particular site only. Ex: If i want to lock http://sharepoint/site1 only lock on site1 not for Http://sharepoint Please suggest me object model code for this. Thakns Anil  

Unknown error trying to lock file

  
Hi This error may have been reported in the forum before. If so I apologise for asking again, but I just can't find any reference to it (or any solution).This is using IE7, Vista Business 64bit, Word 2007To summerise: (step by step)1. We log into Sharepoint (from remote locations)2. We locate the list containing items with attached documents3. Selecting the document gives the "harmful..." message4. Microsoft Word loads up with a certificate warning (which we accept)5. We then are prompted to log in a second time.6. It then prompts with a certificate ("Select Certificate") dialog. (We select OK 3 times)7. Word opens the document in Reader view8. Document reports "Server document" at the top of the screen next to the "Edit Document" option.9. Choose "Edit Document"10. and we get "Unknown Error trying to lock file".The same sequence of events using Windows XP has no problems.Switching back to XP is not an option.Various threads scattered through the internet talk of various solutions from port numbers to running Word in XP sp2 compatible mode. None of these solve the problem. Can someone give me some indication of what is going wrong here. I'm not completely up to speed with sharepoint, but if you ask the questions, I'll dig out the answers.Best regardsRobert

SQL server 2005 lock requests/sec rising linearly non-stop

  
While running an application load test, I am observing some weird behavior. Lock requests/sec counter is increasing in a linear fashion throughout the whole test (duration 12 hours, load levels off to a constant level within first 10 minutes). The value reached 6 million at 12 hours. There was no apparent impact to the response time of the application. There was also no impact to lock wait time (200ms average). Database CPU slowly increased from 20% to about 30% at 12 hours. What could be causing such behaviour?

SQL Server Database Engine cannot obtain a LOCK resource - Advice VERY welcome

  
Since about 07:47 this morning (which is why I fired up a web browser running several programs which used databases on this server) I have been seeing the following error: Event Type: ErrorEvent Source: MSSQLSERVEREvent Category: (2)Event ID: 1204Date: 14/10/2009Time: 10:54:23User: CD\REMOTESERVER$Computer: SQLSERVERDescription:The instance of the SQL Server Database Engine cannot obtain a LOCK resource at this time. Rerun your statement when there are fewer active users. Ask the database administrator to check the lock and memory configuration for this instance, or to check for long-running transactions. For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.Data:0000: b4 04 00 00 13 00 00 00 ´.......0008: 09 00 00 00 43 00 4f 00 ....C.O.0010: 4c 00 4f 00 53 00 53 00 L.O.S.S.0018: 55 00 53 00 00 00 06 00 U.S.....0020: 00 00 53 00 55 00 53 00 ..S.U.S.0028: 44 00 42 00 00 00 D.B... I ran through the guidance provided, but we cap memory use at 16GB and the server is not using more than 5GB. I looked at current locks and no process was using more than 4, a total of about 110 all told. We don't cap connections, indeed we pretty much run with the default SQL settings. The only issue I can see relating to SQL was a failed patch attempt Event Type: ErrorEvent Source: Windows Update AgentEvent Category: Installation Event ID: 20Date: 14/10

cannot lock request

  
Hi, I have been running SSIS job for loading 15 million records from SAP source to SQL Server table having 20 columns. there are no transformations in my DFT.After loading 1 million job has been failed with below error. did anyone has faced this error before. Source: DFT_BW_TO_STAGING SAP BI Source     Description: Cannot lock request 257,488  End Error  Error: 2010-09-18 00:39:39.86     Code: 0x000003E8     Source: DFT_BW_TO_STAGING SAP BI Source     Description: System.Exception: The component could not create a new internal table. hIT=-1885983488     at Microsoft.SqlServer.Dts.SapBw.Connectivity.RFCFunction.Execute()     at Microsoft.SqlServer.Dts.SapBw.Components.OHSExtractor.ExtractNow(Boolean InRuntimeMode, String GatewayHost, String GatewayService, String ProgramID, String ProcessChain, String DestinationName, String ExecutionMode, String PropertyRequestID, Int32 Timeout) What could be the reason behind this result. Any help would be greatly appreciated.Das

How to lock a table during the whole transaction?

  

In my procedure, I need first to run a merge table T using table S and then truncate table S. And other session might insert data into the table S during my execution of the procedure. So I'd like to lock the table in exclusive mode for the whole transaction, but how to do that?

 

If I only lock the table during the merge phase, if after merge completed but before truncate begin, another session inserted some data into it, then the data in S will be missing when run the procedure again.

 

begin

  merge T using S .....

 truncate table S;

end

 

 


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend