.net

In .NET, How do I separate xml from compiled resource file?

We have a customer that would like to modify application user messages that we store in .resx files. I'm thinking this can't be done since the xml file behind the .resx is embedded in a compiled dll. Am I correct? Or, is there a way keep the xml outside of the compiled dll? I realize this can easily be done by other means but I like ...

how to Implement Cruise Control with QTP?

I would like to integrate QTP with Cruise Control, which I have done so far, i'm stuck at the reporting part. I would like to somehow report back to Cruise Control with the results, how can I accomplish this? Please help? ...

With Silverlight what do I need ASP.Net for?

First, I know that Silverlight needs to be embedded in a website, usually an asp page. I understand I need a delivery boy. My question is this; What types of apps/projects are so filled with technological hurdles as to make them ridiculous to do in Silverlight versus ASP.net? I know that with perseverance and flexibility I can probab...

how to tell if a photo was taken in landscape or portrait? JPEG .NET metadata orientation

Thru VB.net/C# is there any way to read any metadata of off a JPEG to tell if the photo was taken in landscape or portrait? I would assume a camera would need an accelerometer first of all to even tell what direction is up...correct? Assuming there is that kind of intelligence to detect the angle of tilt, how would I go about reading th...

Initialization of objects in the background

I need to initialize few objects, it can take a while so I want to do it in some background thread. I also want to display progressBar showing what is the progress of initialization. What is the most elegant way to do it? I was thinking about an interface: interface ILoadable { int Progress { get; } event EventHandler Loaded;...

WCF MessageHeaders in OperationContext.Current

If I use code like this [just below] to add Message Headers to my OperationContext, will all future out-going messages contain that data on any new ClientProxy defined from the same "run" of my application? The objective, is to pass a parameter or two to each OpeartionContract w/out messing with the signature of the OperationContract, s...

.NET - getting form field key/value pairs?

Hi there, I've got a form with textboxes and I want to run some server side validation code on the values after the form is submitted. I was planning to grab all the textbox controls on the page and adding them to a list, then running a for each loop that says for each control in the list query the database where fieldValidation.Name = C...

MSBuild cannot find SGen when compiling a solution

I've looked at several other SGen-related questions on here and either their answers don't apply or their answers don't fix this for me. I have installed several SDKs to fix this issue with no luck. Reference types should not be changed since this is the only place this is a problem. Once suggestion is to put SGen.exe into the C:\Windows...

VS.Net 2008 Unit testing path problem.

I want to have a good test setup but, I can't find a way to put files in the "In" folder under TestResuls. How do I put files in the "In" folder. ...

Error: The magic number in GZip header is not correct

I have two methods, one that I use to convert an image to a Base64 string so I can store it in an XML tag and another to convert the Base64 string back to an image. I'm able to convert the image to a string and store it in the XML, but when I try to convert the string back to an image I'm getting the following error: "The magic number i...

Using ArcSDE API in .NET(C#)

Is possible to use ArcSDE API in .NET(C#) ? http://edndoc.esri.com/arcsde/9.2/api/capi/dbconnects/dbconnects.htm Thanks ...

List of objects plus a tag

I want to store a list of objects, lets say of type Car, but with an additional 'tag' property eg a boolean True/False which does not belong on the Car class. What is the best way to accomplish this? I need to pass the result between methods. ...

Best way to manipulate and compare strings

I'm developing a REST service, so a request could be something like this: /Data/Main/Table=Customers/ I need to get the segments one by one, and for each segment I will decide wich object I'm going to use, after I'll pass to that object the rest of the query so it can decide what to do next. Basically, the REST query is a path on a tre...

contextMenuStrip click events in vb.net

Is there an event that fires in vb.net just before a contextMenuStrip appears when the user right clicks on a control? I need to be able to control the content of the contextMenuStrip just prior to the menu strip appearing. Basically I want to be able to change the content of the contextMenuStrip just before it appears. Is this possib...

Binding an Ilist to datagridview containing another object in a field

I have pretty much the same problem as this question http://stackoverflow.com/questions/970741 but in windows forms, can anyone help me solve it? this is my code, so you don't have to check the other question: public class Material { public virtual int id { get; private set; } public virtual string nombre { get; set; } publi...

Vb.Net Shell App - AutoRestartShell

We have a Vb.Net application that runs as the windows shell for certain users. We'd like the application to automatically restart when it crashes. The application is set as the shell here: HKEY_USERS*User*\Software\Microsoft\Windows NT\WinLogon\Shell I've tried adding an "AutoRestartShell" key with a value of "1", like what exists i...

Derive abstract class from non-abstract class

Is it OK to derive an abstract class from a non-abstract class or is there something wrong with this approach? Here´s a little example: public class Task { // Some Members } public abstract class PeriodicalTask : Task { // Represents a base class for task that has to be done periodicaly. // Some additional Members } public clas...

.NET make a copy of an embedded file resource to the local drive

Hi, i'm new to the realm to working with Files in .NET I'm creating a WPF application in VB.NET with the 3.5 Framework. (If you provide an example in C#, that's perfectly fine.) In my project I have a Template for an MS Access database. My desired behavior is that when the users clicks File-->New, they can create a new copy of this t...

Checking for Objects that implement IDisposable but aren't properly disposed

Is there a way to automatically check existing C# source code for instances of objects that are not properly disposed of ie. using try / catch / finally or using statements? Or do I need to just manually look at the code? ...

How do I Parameterize a null string with DBNull.Value clearly and quickly.

I got tired of writing the following code: /* Commenting out irrelevant parts public string MiddleName; public void Save(){ SqlCommand = new SqlCommand(); // blah blah...boring INSERT statement with params etc go here. */ if(MiddleName==null){ myCmd.Parameters.Add("@MiddleName", DBNull.Value); } else{ ...