.net

How do I list device types using WMI?

I'm using WMI Code Creator to generate code to help list the types of devices shown in Device Manager. I'm trying to detect the presence of a debugger that shows up in Device manager as its own type (e.g. Listed under my computer, the categories are Computer, Disk drives, Display adapters, Jungo..... Jungo is the one I want) Under Jung...

Anti-Aliased Text in a Transparent .NET Form

I have a C# application which shows the current time in a transparent .NET Form. The Form has no controls and no border. Its property TransparencyKey is set to the Form's background color "light gray" to make it transparent. So the user can only see the text (current time). The text is drawn in the PaintEventHandler: private void Dis...

Create google maps trip from a .NET win-app?

Hello. I have a win-application that needs to reproduce a trip for a trucker according to a list of addresses. I was doubting if it's possible to open a browser and transmit the addresses to the google-maps website so it creates the journey for me? If the answer is no, I would you suggest to do it, if I don't have any website, I want ...

Calling a COM+ Component remotely using C#

Hello, I have a little COM+ component as a service on a remote server. I´m trying to execute a method of this component using: Type type = Type.GetTypeFromProgID("ComPlusTest.ComTestClass",serverName); // Create Service Object service = Activator.CreateInstance(type); // Execute Method String result = service.GetType().InvokeMember(...

2 valid requests and then timeout

Here is my code. It iterates all files from database and try to get the length of the web file. It works only 2 times. After that it gives timeout. If i restart the application it process again 2 files and then fail. I have no idea what might be the problem. I appreciate any help. public void GetFilesSize() { List<int> f...

Conversion from String to type Date is not valid error

I have the following date as string "091020". I am using SubSonic as my DAL. When I do myObject.DateColumn = "091020" I get the error "Conversion from type String to Type Date is not valid" I tried playing with the IFormatProvider and CultureInfo but can't seem to get raid of the error. What am I missing? ...

Set a proxy individually for each WebBrowser?

I just found out how to change proxies without restarting the WebBrowser control, but that seems to set it for ALL WebBrowser controls on my form. I want to be able to set a different proxy for each control. Is this possible? If not, is there any tricks I can do to get around this? Maybe some kind of daemon that watches a port and trans...

Is it possible to create an installer that includes ms sql express? (wihtout separate exe)

Is it possible to create an installer that includes ms sql express? I currently install ms sql express via setting the setup project's pre-requisites. It outputs 2 files, an msi and a setup.exe. The setup.exe will detect is SQL express is installed and install it. It works great. But now I have to distribute 2 files... I'd like to ...

Split button in .NET Winforms

I'm looking for a Split Button in .NET WinForms. The kind where one side is a button and the other side has a dropdown button. I see them used all over in windows, like in the Visual Studio Save As window, so I figured they've got to have the control in some library. I know there's one for toolstrips, but I need one thats usable out...

Stackpanel with widthstyle set to fill?

I am in a situation where I want to add usercontrols in a panel. This has to be in a topdown order. I have done whats explained here to make it act like a stackpanel. However I want the width of each usercontrol to fill out the panel and not be a fixed size. I tried using tablelayoutpanel and setting it grows attribute to 'add rows' bu...

ASP.Net Ajax PageMethod - retain reference to DOM object

When calling an ASP.Net PageMethod, we call it as follows: function doSomething(htmlElement) { PageMethods.GetText(onSuccess, onFailure); } What is the best way to retain a reference to the htmlElement in the above example, so that we may continue to work with it in the onsuccess method? Thanks for any help in advance ...

Dependency Injection and .NET Attributes

I have a couple of method attributes which do some logging. Our logging code sits behind an interface (ILog) and I'd like it if the attributes were only dependent upon that interface as opposed to an implementation. This isn't really about testability or dependency inversion so much as it is about keeping the coupling of components clean...

.NET 3.5: What is the "ValidatorCollection.IsSynchronized" Property "synchronized" to?

Hi, I understand that in .NET 3.5 the ValidatorCollection.IsSynchronized property return a Boolean telling me if it is synchronized or not. However, I'm having a hard time understand what is it synchronizing with or to? The MSDN manual simply says: Gets a value that indicates whether the ValidatorCollection collection is synchro...

C# .NET String object is really by reference?

Hi, I have being studying (newbie) .NET and I got some doubts. Reading from a book examples I learnt that String are object then Reference Type. So, I did this test and the result was different what I expected: I'm really curious, is this an exception because "string" are special types? class Program { static void Main(string[]...

What are guard methods/classes?

i just noticed the guard method/class mentioned in this question and i don't really get the concept from the answers. And alas, Jon Skeet's link to an MS site never loaded. A few quick Google searches seemed to yield only products, not software engineering concepts. Any explanation and/or samples would be appreciated. (Especially from t...

.NET 2.0 Client fails to deserialize valid Apache-SOAP web service XML, shows null for all properties

A coworker has made a Java web service running on the Apache-SOAP runtime on a Tomcat 6 server, but only tested it using Eclipse's built-in tool and SoapUI. The output of this service is an array of objects which are each composes of five string fields. I need to write a .NET client to consume this service, and I used Visual Studio 2005 ...

Mouse Gesture Libraries for .Net?

Are there any half decent mouse gesture libraries for .Net? Have found very few and no decent ones. ...

How to get callbacks for a ListView sub-item? (Partial Owner-draw)

I have a ListView that contains items with four columns. The values in three of the columns are pretty much fixed (although editable via an item editing dialog), but the value in the fourth is an index, and I want it to be calculated on the fly. I know that I could use an owner-draw list, but, unless I don't get the examples in MSDN, it...

LINQ to SQL in ASP.NET MVC results in DuplicateKeyException

I'm following the Sports Store example in Pro ASP.NET MVC Framework and I'm getting an exception related to LINQ that I cannot figure out. The full code is available through the website but here is a snippet to convey the problem. private Table<Product> productsTable; // ... public void SaveProduct(Product product) { if (product.Prod...

Testing Finalizers and IDisposable

Hi, The question is how can I test the fact that object disposes resources when finalise is called. The code for the class: public class TestClass : IDisposable { public bool HasBeenDisposed {get; private set; } public void Dispose() { HasBeenDisposed = true; } ~TestClass() { Dispose(); } } Plea...