.net

How do I programmatically get the GUID of an application in .net2.0

I need to access the assembly of my project in C# .NET2.0. I can see the GUID in the 'Assembly Information' dialog in under project properties, and at the moment I have just copied it to a const in the code. The GUID will never change, so this is not that bad of a solution, but it would be nice to access it directly. Is there a way to ...

Are StringBuilder strings immutable?

StringBuilder has a reputation as being a faster string manipulation tool than simply concatenating strings. Whether or not that's true, I'm left wondering about the results of StringBuilder operations and the strings they produce. A quick jaunt into Reflector shows that StringBuilder.ToString() doesn't always return a copy, sometimes ...

Binding in a WPF data grid text column

I'm trying to build a data grid where one of the columns is a font name displayed in that font. Previously, I was working with a list box where I had defined the following template: <TextBlock Text="{Binding Path=Name}" FontFamily="{Binding Path=Name}"/> This worked just fine. So, I tweaked the data structure (Name became Font.Name) a...

Google Chrome extension for Click Once?

I have a client that wants to use Google Chrome for an internal web app we've developed(I don't blame him, I really enjoy using chrome!) The problem is we have a win forms app that the users can launch from the browser, deployed using click once. I've known for a while that chrome doesn't support click once, but I figured by now there ...

Know if app is installed for "All users"

How do detect if my app was installed for "All users" or just for one user. Today I check for files put in either Environment.SpecialFolder.CommonApplicationData or Environment.SpecialFolder.ApplicationData by my installer. Is there a better way? ...

Pinvoke call for getting the windows serial number?

The normal way to get the windows serial number is WMI. ManagementObjectSearcher mos = new ManagementObjectSearcher("Select * From Win32_OperatingSystem"); // ... // Select number from managementobject mo["SerialNumber"] I don't want to use WMI because the compact framework dosn't support it. The assembly must work on the desktop a...

Disposing WPF User Controls

I have created a custom WPF user control which is intended to be used by a third party. My control has a private member which is disposable, and I would like to ensure that its dispose method will always get called once the containing window/application is closed. However, UserControl is not disposable. I tried implementing the IDisposab...

WCF - advantages and disadvantages

I would like to find out about BOTH advantages and disadvantages of Windows Communication Foundation from people who have used it or just know it theoretically. ...

Analyze the use of a ASP.NET webservice

Hi, long time ago I wrote webservice that is still in use. Now I plan to refacture it. The webservice is full of most likely unused functions and I have no idea how it is used by the clients. In order to strip away the unused functions I need to analyze the function calls and data of currently installed webservice. Is there a (free/ope...

How to lock a line of a table

Hello. I have an application that runs on a terminal. The terminal is registered on a database table. During all session that application is running on a terminal, I need to ensure that the line of the table corresponding to the terminal is locked and nobody can update that. What is the best way to do this? I use C#.NET as programm...

Role security with active directory

Hello, I have to ensure the security of a asp.net website at work. they ask me to do a role based security with the active directory of my work so i could do a sitemap and give the right acces at the right personne. wich class of the framework should i use? make generic identity? ...

How to determine if a type implements a specific generic interface type

Assume the following type definitions: public interface IFoo<T> : IBar<T> {} public class Foo<T> : IFoo<T> {} How do I find out whether the type Foo implements the generic interface IBar<T> when only the mangled type is available? ...

Best Layout of a WinForms UserControl with both Static and Dynamic Content?

I have a user control that has: a) a buttons panel at the top (it always has to be visible) b) a panel with controls that are dynamically added and re-sized at run-time. The controls can be many, so the panel has to be scrollable. This user control will be hosted in a form, with the following requirements: a) The initial size of the for...

Problem Converting byte[] to Bitmap c#

Hi, I have an urgent problem, i'm trying to convert a byte array to a bitmap but it always shows me: System.ArgumentException: Parameter is not valid. my code is as follow: Im passing the bytes through a webservice with: string DecodedString = string.Empty; DecodedString = System.Text.Encoding.GetEncoding(1251).GetString(bytes); s...

Intersecting GraphicsPath objects

How can I intersect two (.NET) GraphicsPath objects? ...

What is the best way to integrate a report designer in a .NET application?

I need a solution in order to provide customers the ability to customize their own reports, without any IT knowledge. I need a designer easy to integrate with my .NET (C#) application. What is the best solution/product, if any? Or should I consider to develop my own? Thanks all, G. ...

Getting Real Done for Real Windows Programmers?

Anybody tried here using Getting Real(37Signals) approach to develop windows application? (C#/.NET). Or simply put, developing project using agile. We develop windows application which sucks development time. We never get concrete UI definition from Client. We never had any decent design due to this problem or something else. How do yo...

How to get the value of a control from the child into the properties of the parent in .NET?

I have a form that has a few similar controls and the parent contains the properties, but the child actually has the html controls. How could I setup my getters/setters using the "child" controls in the parent class? (Webforms - fyi) I found the below via search, and what I'm looking for is the inverse http://stackoverflow.com/questio...

Using managed C++ dll from C#

I've created a dll using managed C++. Now I'm trying to use it from C#. I've added the Object to project references. Object browser shows the object in the dll correcly, path to the dll in object browser corresponds to the actual path. However, when I run the C# program it complains: Unhandled Exception: System.IO.FileNotFoundException...

In C#, can I use reflection to determine if an enum type is int, byte, short, etc?

Is this possible? I can't find it anywhere. Thanks! ...