.net

WPF Resize Windows

I maintain a touch screen application that I'm re-writing into .Net. Through the years the resolution of the touch screens has increased greatly. Not only is the resolution higher, but the pixels are also much more dense making it harder to see/operate the touch buttons. Is there a way with WPF to force application windows to scale t...

Which is the best managed .NET e-mail component with support for S/MIME?

I need a replacement for System.Net.Mail.MailMessage that is able to send signed and/or encrypted e-mails. Is there an open source library covering that? Or do you have some experiences with some of those: Chilkat Mail Easymail Dart Mail for .NET You got more? ...

XML serialization question

Have an XML with next form: <categories someAttribute="test"> <category id="1"> <title></title> </category> <category id="1"> <title></title> </category> </categories> There is no way to change XML structure. But what I want is to replace buggy hand coded XML generation with XMLSerialization. Please help with those C...

Best practices for fixed-width processing in .NET

I'm working a .NET web service that will be processing a text file with a relatively long, multilevel record format. Each record in the file represents a different entity; the record contains multiple sub-types. (The same record format is currently being processed by a COBOL job, if that gives you a better picture of what we're looking a...

How can I dynamically change the order of my GridView columns in WPF?

I have two radiobuttons. If I click the first radiobutton I want the column's order to be: AssetName Asset Groups TypeName Iprisklevel If I click the second radio button I want the column's order to be: Groups AssetName Asset TypeName Iprisklevel Here is a sample of my XAML: <asp:GridView ID="dgAssets" runat="server" AutoGe...

How to keep datetime2 column inserts unique

I have a table that stores stock ticks in sql server 2008. It is keyed on the symbol column and the datecolumn which is a datetime2. In a c# app inserts are sent in at a high rate to the table. Currently a row is made using the symbol and DateTime.Now and then inserted. Occationaly the situation can arise where 2 ticks for the same s...

.NET Why can a string[] be passed as IEnumerable<string> parameter?

This is valid code: void func(IEnumerable<string> strings){ foreach(string s in strings){ Console.WriteLine(s); } } string[] ss = new string[]{"asdf", "fdsa"}; func(ss); What I want to know is, how does the implicit conversion string[] -> IEnumerable<string> work? ...

Best way to check if a TCP connection is active

Given a list of IP addresses how do I programmatically check if the local machine still has active TCP connections to these IP Addresses? I am using C#. ...

.net code to read email into a sql database

I am looking for some links and/or code snippets that will allow either an asp.net webpage, (or alternatively an outlook add-in) that will allow me to read emails sent to a particular email address, and then parse apart the email message into component parts (i.e. subject, body, attachments etc) and save to my database. The basic subjec...

Need to use win32 api to copy files in c# - how do I do this?

I'm trying to copy some files around, and occasionally the lengths of the names exceeds the length that the System.IO.File.Copy method can accept (260 chars according to the exception that is getting thrown) According to the research I've done, I should be able to use the win32 api's file methods in conjunction with \?\ prepended to pat...

How to remove duplicates from int[][]

I have an array of arrays - information about selection in Excel using VSTO, where each element means start and end selection position. For example, int[][] selection = { new int[] { 1 }, // column A new int[] { 6 }, // column F new int[] { 6 }, // column F new int[] { 8, 9 } // columns H:I new int[] { 8, 9 } // columns H:I new int[] ...

Table operation .net library

In some webpages that I have, I must join some datatables in memory and then use the result as a datasource for a gridview. This in-memory join is the only solution, and I have written a method that takes care of it. I was wondering if there is any library out there that can do such things and other table operations, like ordering and...

How to force Webbrowser component to always open web page in the same window?

Hi, I need to use webbroser in my application as it keeps repetitive tasks from employees, but there is aproblem with javascript that opens a new window in IE after clicking on anchor. How do I tell webbrowser component to "open new window" where I want it to be opened? For example in the other webbrowser component? ...

Should I bother learning Windows Workflow?

Okay, so I've learned WPF and WCF and that was great. I didn't bother with CardSpace because it's probably not gonna take off. Should i bother with Workflow,..is it worth it? What's the big deal? ...

Should I follow the Event Pattern for internal events?

I understand the advantages of using the EventHandler/EventArgs pattern for events, it does however add a lot of overhead. public class FooBarEventArgs : EventArgs { public int Arg1 { get; set; } public string Arg2 { get; set; } } public event EventHandler<FooBarEventArgs> FooBar; Would you break the event pattern for internal ev...

How do I set up smtp on Vista so I can use System.Net.Mail?

Hi, From what I understand there is no SMTP server in IIS on Vista. I am working on a project which will require me to send email. I'd like to start with some simple prototypes on my development box which is running Vista Ultimate. I'm not connected to a corporate network where I can just use an exchange server someplace. I realize ...

.Net: Nested References

How smart is Garbage Collection when it comes to nested references? Take this code for example: Public Class SomeClass Private m_SomeOtherClass(Me) End Class I know that GC works by looking at how many references remain, and any object without any references ends up getting dumped. So in this case, where there's a reference comi...

User Friendly Exception Handling Libraries for WinForms (.NET)

I'm trying to find a nice library for user friendly exception handling for unhandled exceptions. I found the following one: http://www.codeproject.com/KB/exception/ExceptionHandling.aspx Is there any other similar projects out there LGPL/Free (or cheap). I'm looking for features like: User friendly crash screen Remote Logging with a...

Installation problems of C# deployment

I have a program I deployed using click-once deployment and then installed on my machine. I tried running it, and it gave me the following error: PLATFORM VERSION INFO Windows : 5.1.2600.196608 (Win32NT) Common Language Runtime : 2.0.50727.3053 System.Deployment.dll : 2.0.50727.3053 (netfxsp.050727-3000) mscorwks.d...

How would one use System.Uri .NET class to check if the URL is valid?

In one of the previous posts it was suggested to use System.Uri to check if the URL is valid. How does one do that? ...