.net

Convert MIME tree to MailMessage

I'm writing a a C# program that processes and forwards email messages. I have a POP3 library and a MIME parser, and I need to copy the MIME tree into a System.Net.Mail.MailMessage. What is the best way to map different MIME parts to AlternateViews, LinkedResources, and Attachments? EDIT: That will work with all mail clients (both send...

.net mvc ViewPage<T1> and ViewUserControl<T2> behaviour

I've got a viewpage with the inherits part looking like Inherits="System.Web.Mvc.ViewPage<User>" and a ViewUserControl with the inherits part looking like Inherits="System.Web.Mvc.ViewUserControl<Address> where User class (shortened) essentially looks like: class User { public virtual Address address { get; set; } } Now, if I t...

Registering my .net assembly for COM interoperability doesn't expose my methods.

Ok, I'm going crazy. I've been trying to make a simple .net assembly visible to use as a COM object but it's not working. I've been trying a lot of different aproaches but none of them work. So far the closest i've got is the one with the least amount of attributes, interfaces, manually registering etc. I have a vbscript as a test which...

MSBuild builds projects with project references correctly but not from solution

When i build a A.sln which includes 2 projects B.csproj and C.csproj which has internal project references it throws reference errors in MSBuild. But when i build B.csproj and C.csproj seperately in MSBuild it don't throw errors. And also building A.sln in VS IDE also don't throw errors.I'm using .NET 2.0 framework. Please find below the...

.NET inter-process "events"

I have multiple instances of the same application running. The user ask can click "Quit" on each instance to shut it down. I would like to add the choice to "Quit All Instances", which will raise some kid of "event" that notifies all instances of the application that they should close. I don't need to transport any data along with this ...

Calling a method with ref or out parameters from an anonymous method

This question is related to one I asked the other day which I got some good helpful answers from. I needed to call various web methods with varying signatures in a generic way. I wanted to be able to pass the web method to a method which had a delegate argument but I was unsure how to deal with the varying signatures. The solution was t...

Visual Studio Settings file - how does it work?

Hi I do not understand the following things: What is the difference between app.config (applicationname.exe.config) and settings file ? I am unable to locate the *.settings file in Windows7 AppData directory under the specific account (I heard that it should be located somewhere over there) ? Let's assume that *.settings file is somew...

Is it possible to redistribute .NET Framework 3.5 32-bit only?

The offline installer for .NET Framework 3.5 SP1 is 200 MB large. We're wondering whether it's possible (both technically and legally) to split it up by target architecture - so as to produce a separate installer for the 32-bit version. The idea is that it might be significantly smaller. I am aware of the bootstrapper, which will only d...

LocalReport Render Fails with Images from Nikon Coolpix 5600

i have a RDLC with a embedded Image taken with a Nikon Coolpix 5600 that raises the following error when i call the Render function. example image: http://img140.imageshack.us/img140/4906/dscn1559u.jpg does somebody know what`s wrong with that image? tia The Error: [ArgumentOutOfRangeException: Nicht negative Zahl erforderlich. ...

How to set color array into another color arrays?

My below Codes gives me error:"Index was outside the bounds of the array." My Algorithms create Colorset arrays that's arrays dimention '16', But i need Second one 'colorSetLegend' that's dimensions:32 if you look below Bold codes that returns me error. Color[] colorSetLegend = new Color[32]; Color[] colorSet = { Color.Re...

In .NET, how can I detect whether a user has a specific redistributable installed?

I have created a class which builds a Crystal report and displays it in a report viewer. However, without the Crystal Redistributable, the code crashes. How can I programatically detect whether the end-user has the Crystal DLL installed? The code I am required to include is: Imports CrystalDecisions.CrystalReports.Engine Imports Cryst...

How do I compress a file with GZipStream and maintain meta-data about the original file?

How can I get the extension of compressed file after being compressed with System.IO.Compression.GZipStream? For example, if the original file is named test.doc and compresses to test.gz, how do I know what file extension to use when decompressing? ...

.NET Web Service -- New Methods not appearing...

Building a test web service and all was working great, so I added the rest of my methods and now they aren't appearing in the "View in Browser" test page. I stopped the service in the system tray. Did a CLEAN. Did Rebuild. Did Build. Tried all these several times. Odd thing is that one of my new methods replaced one of the old metho...

Should I pass sensitive data to a Process.Start call in .NET?

I'm working on a .NET Windows application that will use Process.Start to launch another internally developed .NET application running on the same PC. I need to pass database connection information, including a user ID and password, to the target application. I'm trying to determine whether I need to encrypt the information before I send ...

VB.NET WebCam

I need a WebCam component that is only .net(if it builds on Win API or DirectX its ok) the functions i need are: Preview Select Input device Set Resolution Get a Image ...

Duplicate Rows when Data Binding with LINQ to Entities

I have problems binding both a telerik RadGrid and a plain vanilla ASP.NET GridView to the results of the following LINQ to entities query. In both cases the grids contain the correct number of rows, but the data from only the first handful of rows is duplicated in all the other rows. I'm directly assigning the return value from this c...

Inject HTML to server control

How do you inject HTML to a server control? I'm creating a calendar control and have some javascript/css that go with it. In addition, I have some html code that gets generated with the proper ClientIDs that work with the JS/CSS and I would like to inject this to where the "server" control is used. For example: <MyUC:UC1 ID="someUC" ...

Consuming a queue's messages with the processing resource varying by message type

I'm having some trouble putting together an algorithm for an asynchronous queue consumer thread, that is reading items off of a single queue that need to be dispatched to do some long running (several seconds at least) work. Basically the queue can look as follows: A, A, A, A, A, B, B, A, B, A, A, A, A, A, C, B, A. Ie. the A messages a...

WPF ListView question

Hello guys, this is my first question here. I'm getting started with WPF and i am stuck. Here is the problem: I have a ListView as following: <UserControl.Resources> <DataTemplate x:Key="FirstCell"> <StackPanel Orientation="Horizontal"> <CheckBox Margin="2"></CheckBox> </StackPanel> </DataTemplate>...

How to specify which control should be focused when a form opens?

Whenever a Form is opened, the system automatically focuses one of the controls for you. As far as I can tell, the control that gets focus is the first enabled control in the tab order, as per Windows standard behavior. The question is how to change this at run time without having to dynamically reshuffle the tab order. For instance, so...