Can we detect the laptop battery level using .net?
I would like to detect the laptop battery level so that I can warn of low battery level using my application is it possible in .net ? Thanks in advance. ...
I would like to detect the laptop battery level so that I can warn of low battery level using my application is it possible in .net ? Thanks in advance. ...
Hello Friends, I am working on an asp.net application.. when I try to compile and run the application; it runs successfully. But when I try to debug the application it gives me error at any point - A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll It doesnt give error at any specific co...
I want to create dynamic load for items in Silverlight Listbox. When user reaches end of items by scroll bar (or mouse wheel), then I want call new request for next 10 (or some different) items. And problem is which event on listbox can handle this? ...
I'm looking for examples for .net gridView themes (css files) to get ideas for my grid. My grid must have a double-pager look (Bottom & Top) and should support sorting (by clicking on headers) and row highlighting when moving the mouse. The only one I found online was the Glassy Black (http://weblogs.asp.net/kevinbrammer/archive/2008/0...
Hi, I'm new to reflections. I need to create a class which inherits from a parent class. I need to create a readonly property. This property calls an existing function in the parent class by passing an argument 25. Everything works fine, except that I am unable to pass the value 25 to the function being called. Below is the code that ge...
The list is sorted. I have a List and I d like to do binary search on it. T has members like StartIndex, EndIndex etc. I can do binary search on the list with StartIndex, ie: I have implemented IComparable for this. I need to twist this a little as the following: I want to find a StartIndex that might be OffBy a small value. For exam...
I have a simple windows Forms application where in I have a usercontrol called "MyControl" derived from PictureBox. In this MyControl, I have the following code : Sub New() MyBase.New() Me.BackgroundImage = My.Resources.MyImage 'This is a project resource image End Sub Now when I drag and drop this MyControl into a form, I get ...
Control.Invoke executes the specified delegate on the thread that owns the control's underlying window handle. For years I have just accepted that this is the way it has to be, but I have never understood why. The only thing I can think of is that the code is terribly thread unsafe, and instead of just adding a little synchronization...
I have a class that handles TcpClients. What the class should do is: while the other end has not done a graceful close or we are stopping { receive a request process it send response } As I don't know when the other client will send a request I can not do a Read with a timeout set, so what I have un...
I have a WCF service that I expose using different endpoints, one of which uses NetNamedPipeBinding. The other endpoints use a custom username/password validator to authenticate users, but as far as I can tell, this is not supported by NetNamedPipeBinding. How can I add a custom username/password authentication mechanism to a NetNamedP...
How can I about getting a user's group memberships from AD, preferably using the same pattern as I use to get the user's Department property, as below? I have found several examples, but the intersecting set of all example techniques is quite small, and lacks the tightness and simplicity of this Department query: var adServer =...
what are other ways to do ping in vb.net or c# other than the way found here: Dim pinger As New System.Net.NetworkInformation.Ping MessageBox.Show(pinger.Send("192.168.0.119").Status.ToString) ...
When the WCF service is turned off, I'm gonna catch this exception like this. public List<ProjektyEntity> GetProjekty() { try { return this.channel.GetProjekty(); } catch (EndpointNotFoundException exception) { //what to do at this point ? } } But i don't know what t...
Hello All One of my friend told me that dynamic method is the only way if you want to at run time construct code that can be garbage collected. One question in my mind that how garbage collector garbage the object which generated using reflection? ...
Hi, we have the following scenario: * a .NET application allows users to upload documents. * the documents are stored in a filesystem, currently inaccessible to users. the path is basically \year\month\day\filename.ext * the path and filename are stored in a database (MS SQL200) that is used to link the documents to various records in th...
See this scenario: 1-I have a single ObjectContext instance shared between multiple business logic layer classes to avoid identity and tracking problems when using multiple object contexts. 2-An object of a class tries to create and insert an entity but an exception takes places (because of a foreign key constraint, unique key constrai...
I have an unbound DataGridView, which fill manually with DataGridViewRows. AllowUserToAddRows is set to false and everything works as expected - no NewRow is shown in the botomn of the grid. In one method I add some more rows, edit some rows and remove some others. These manipulations work fine, BUT after these manipulations the NewRow ...
I am reading a blogpost at: http://flyingfrogblog.blogspot.com/2009/07/ocaml-vs-f-burrows-wheeler.html a simple implementation for Burrow Wheeler compressing algorithm: # compare two strings str[i..end,0..i-1] and str[j..end,0..j-1] let cmp (str: _ array) i j = let rec cmp i j = if i=str.Length then 1 else if j=str.Length t...
Ok so I ve step up a very simple asp.net and wcf service to use and STS for authentication, however, I wonder how can i achieve the same if configuringing it programatically. I know I need to have certain information in web.config , I can also seee that from my client I have access to the namespace Microsoft.Identity.Configuration names...
I see a lot of posts of people using compiled Linq to Sql queries for high-demand asp.net applications. I've done some performance tests and in many cases compiled queries are better than the ordinary ones. What bothers me is that when using compiled queries the query is preserved in a static variable. In asp.net in many cases it is not ...