.net

Are there any valid stats showing cost benefits of working in PHP compared to .NET?

It's a bit of a leading question, I know, but this question came up in a PHP Users group discussion and I was interested to see if there were any studies done comparing the two (regardless of who "wins"). I can see there are many tangibles to compare in licensing, IDEs, hosting, etc., as well as the intangibles of amount of time spent o...

Does LINQ to SQL use the ActiveRecord Pattern?

I've just been researching the ActiveRecord pattern, and based on this (http://en.wikipedia.org/wiki/Active_record_pattern), it seems Linq 2 Sql more or less implements this, am I wrong? or what would need to be changed for it to conform to the ActiveRecord pattern? ...

Obviously this is not the correct way to read with SerialPort

Hi, Let's say I want to have a function which reads data from the SerialPort and returns a byte[]. public byte[] RequestData(byte[] data) { //See code below } Something as simple as this really doesn't work/perform well and isn't very reliable: byte[] response = new byte[port.ReadBufferSize]; port.Open(); port.Write(data, 0...

Get Log off event from system.

I am doing an application which is used to clear the Temp files, history etc, when the user log off. So how can I know if the system is going to logoff (in C#)? ...

Call cancel on thread when pressing ctrl+c

I've written a console application that basically fires one BackgroundWorker that supports ReportProgress and Cancel. How can I make sure that before a window is closed (by pressing the close button or pressing ctrl+c) the cancel operation is triggered on my thread and the window only closes after the cancel is completed? ...

Set background of DateTimePicker.

How can I fill the background of drop down calender of a DateTimePicker with gradients? ...

XmlSerializer serializing sub objects

How do you serialize the following [XmlRoot("response")] public class MyCollection<T> { [XmlElement("person", Type = typeof(Person))] public List<T> entry; public int startIndex; } where T can be a class like public class Person { public string name; } into <response> <startIndex>1</startIndex> <entry> <...

Stack Overflow error on Color Changer Function

i have two color "red" also "Salmon". i need create dynamiclly panel also panel background color. These colors must be between two color(red public Color x, y; protected void Page_Load(object sender, EventArgs e) { BackGroundColorArranger(Color.Red, Color.Salmon); } void BackGroundColorArrang...

Where can I get the compiled HtmlAgilityPack Library?

Does anybody know where can I get the compiled HtmlAgilityPack Library? ...

Comparing hash passwords

I'm using .net 3.5. The problem here is that I cant seem to get the passwords to match. I have tried using the ComputeHash method on both, but it generates a different hash. As they are now the arrays are different sizes. (Obviously they are based on the same string). What have I done wrong? ("password" is byte[] param by user input) ob...

Is there a way to force an "Any CPU" compiled app to run in 32bit mode on 64bit OS?

If I have a "Any CPU" compiled .NET app, it will run in 64bit mode on a 64bit OS. But if I, for whatever reason, wants to force this app to run in 32bit mode. (As if it were compiled using "x86"). Recompiling is not an option, so is this possible to config at run time ? With the .manifest file perhaps? ...

Pointers in C# ?

In one C# maintenance project I came across following variable declaration: Int32* iProgressAddress; Is it pointer declaration in C#? I thought that there is no pointer concept in C#, what does that statement mean? ...

How would I use regex to parse HTML to plain text

How would I use regex to parse the following: <b>HelloWorld</b> <p>This is a test</p> <a href="myUrl">Google</a> All html tags need to be removed and the urls extracted from hyperlink tags, and the result should be: HelloWorld This is a test myUrl ...

Databound combo SelectedItem doesn't seem to work.

I'm attempting to bind a combo to a collection of objects: Dim t As New TradeOrderStatus() Dim ts As List(Of TradeOrderStatus) = t.GetStatuses With Me.cboTradeStatus .DataSource = ts .SelectedItem = Nothing End With This works fine and I see the list of items in the combo. However when I try to set the...

How do I encrypt a string and get a equal length encrypted string?

My problem is the following: In an existing database I want to encrypt data in a couple of columns. The columns contains strings of different lengths. I don't want to change the size of the columns so the encryption need to produce an equal length text representation of the input text. The strength of the encryption algorithm is of se...

retrieving executable information

When you right-click an .exe file, you can see various details, such as file description. I'm looking for way to retrieve that data programmatically (preferably, from C#). (Program's name, program's description, Vendor's name, Vendor's site etc) ...

no output from .NET console app run from psexec

I'm having a very strange problem where I run a managed .net console app on a remote server using psexec. I get this error "The process tried to write to a nonexistent pipe". Now I wrote an unmanaged C++ program to output to std::cout, and it works just fine. Interestingly, if I run cmd.exe remotely, and use the /u (unicode) option, I...

c# Reflection object[] issue

Hello, I am trying to use reflection to create object array of the type created from reflection like the folowing: Client[] newArray = new Client[] {client1, client2}; I need to somehow get the Client object type to create the object so it can be passed through. Any help would be greatly appreciated. Cheers, Rob object clientObjec...

Need Help With Storyboard to Mimic the Way IPhone Flips Album Art

Trying to mimic the way the IPhone flips the album art to the songs list. I want to pass in two generic objects and have the storyboard flip them. I can get the slide effect, but have not figured out how to scale the object so it appears to be rotating and not just sliding. Thanks, Dave ...

Nullable struct vs class

I have a simple struct which contains two fields; one stores an object and the other stores a DateTime. I did this because I wanted to store objects in a Dictionary but with a DateTime stamp as well. I've got a method which returns my structure, and I've now decided the method should also be able to return null, so I made my structure n...