.net

Need help with multicast udp server discovery in c#

As kind of a followup to this question I've gotten a solution working on my local machine, but not on a machine on the network. I don't know too much about sockets other than that basics, so bear with me. The goal is for a client to look for a server on a local network, and this is the result of some cut/paste/edit code. This is the...

Filter EntityDataSource on Association value

I really like Entity Framework, but there are some key pieces that are a challenge to me. Can anyone tell me how to filter an EntityDataSource on an Association column? EF hides the FK values and instead has an Association property. Given an Entity, Person, with a PersonType association, I would have expected something like this to work ...

Capturing key press messages

We're building some software for an in-house Kiosk. The software is a basic .net windows form with an embedded browser. The Kiosk is outfitted with a mat that the user steps on. When the user steps on the mat, it sends a key comination through the keyboard. When the user steps off the mat it sends a different key combination. What we...

How can you get the names of method parameters in C#?

If I have a method such as: public void MyMethod(int arg1, string arg2) How would I go about getting the actual names of the arguments? I can't seem to find anything in the MethodInfo which will actually give me the name of the parameter. I would like to write a method which looks like this: public static string GetParamName(MethodI...

winforms html editor

Anyone know of a good free winforms html editor for .NET. Ideally I would like html and preview modes along with the possibility of exporting to a pdf, word doc or similar. Although the export I could probably create myself from the html output. Another nice feature would be a paste from word that removes all the extra tags you usuall...

how to change default path for Properties.Settings

Hi Whenever I do Properties.Settings.Save(), it commites the properties changes to Application.LocalUserAppDataPath but I want the path to be Application.CommonAppDataPath. where Application.CommonAppDataPath = C:\Documents and Settings\**All Users**\Application Data\xxxxx\xxxx\1.0.0.0 Application.LocalUserAppDataPath = C:\Documen...

User Drawn Controls are using the previous Forms Background.

I have several user drawn controls on a form, unfortunately when the form is shown the user drawn controls are showing the previous forms background rather than the current forms background. The OnPaint event is very simple, and the OnBackgroundPaint event is empty... Like this: protected override void OnPaint(PaintEventArgs p...

Help troubleshooting System.BadImageFormatException:

While debugging through a .NET 3.5 SP1 project which is contacting a local web service, I'm receiving the exception System.BadImageFormatException: "Bad Class Token" Of course there aren't much more details about what's causing the exception. I can tell that the method where this occurs, which is in the same class as it's caller, the ...

How scalable is LINQ?

Recent conversations with colleagues have produced varying points of view on this matter. What say you, SO members? I know, even the concept of scalability can be taken in so many different ways and contexts, but that was part of the discussion when this came up. Everyone seemed to have a different take on what scalability really means....

machine.config path

How do I get the path to the machine.config from a .Net application? It should automatically get the correct path based on the .Net version of the app. ...

How to compare dates in LINQ?

I want to check if a given date is more than a month earlier than today's date using LINQ. What is the syntax for this? Thanks in advance. ...

Where do I get the ULONG LoginID values to pass to WTSConnectSession?

Where do I get the ULONG LoginID values to pass to WTSConnectSession? I need both a ULONG LogonId and a ULONG TargetLogonId. Is this the same as the SessionID I'll get back from WTSQuerySessionInformation when I pass in WTSSessionId? I suspect not (I tried it and WTSConnectSession did not work.) The MSDN glossay says a logon identifier...

Whats the best way to programatically add a .swf to an asp.net page?

Is there a good way to add a .swf programatically to a panel on an asp.net page - ie: I know i could just insert the html tags: ie: <object type="application/x-shockwave-flash" data="yourflash.swf" width="" height=""> <param name="movie" value="yourflash.swf"> </object> But is there an existing .net or free FLASH component already t...

I can swear i once did " new Literal("<b>hello there</b>");

I could have sworn i have done this somewhere - im using 2.0 right now - was this something i found in a later version? IE: pass the content of a Literal in the constructor I remember myself saying 'huh, and all this time i created a new instance and then set the text property' - or did I go to sleep drunk that night? And if not, WHY ...

Will Google Android ever support .NET?

Now that the G1 with Google's Android OS is now available (soon), will the android platform ever support .Net? ...

Why does the .Net framework guidelines recommend that you don't use ref/out arguments?

Apparantly, they're "confusing". Is that seriously the reason? Can you think of any others? ...

Why is new .NET code from Microsoft not Microsoft StyleCop compliant?

I just downloaded the ASP.NET MVC beta and the templates are not StyleCop compliant. Why is new .NET code coming from Microsoft not StyleCop compliant? ...

Strings or URI in .NET APIs?

I am writing an .NET wrapper API for the Netflix API. At this point I can choose to represent URLs as either strings or URI objects. Seems to me there is a good case for both. So if you were using an API, which would you prefer? ...

Should I agree to ban the "using" directive from my C# projects?

My colleague insists on explicitly specifying the namespace in code as opposed to using the using directive. In other words he wants to use the fully qualified name for each type every time this type occurs in code. Something like public class MyClass { public static void Main() { System.Console.WriteLine("Foo"); } ...

how to handle 100mb uploads for users.

Hi all, i've been approached to create a bespoke ftp app that users will download in order to be able to upload video files ( up to 100mb). they want it to be idiot proof ( ie easy for non-computer literate people ). I'm assuming that setting up an ftp app like FileZilla with their username and password would be too much of a stretch ...