.net

Checking for .NET dependencies before launching

I have several apps that I work on and like to distribute to friends that require Microsoft Provided .dlls and or frameworks. Specifically, XNA. I'm tired of getting emails back from them saying "It crashed" when in reality, all that's happened is they don't have XNA (or .NET 3.5, or whatever) installed. However, Main can't catch thes...

Encrypting with app public/private key in .net

-new- I found another use. Theres some data submitted to me via HTTPS POST data and i'd like to store it in my db (Such as mother maiden name that customer support may need to read later instead of spelling incorrectly checking if the hash matches). I only need that section encrypted and not the entire DB and using a separate DB may not ...

Using .NET BackgroundWorker class in console app

I am relatively new to .NET programming and multithreading in general, and was wondering if it is ok to use .NET provided BackgroundWorker to spawn off worker threads to do some work in a console application? From the various documentation online, I see that intent for this class is more for UI oriented applications, where you want to do...

How can you use a .NET service object within Adobe Flex

How can I use a .NET service object in an Adobe Flex application? Is it even possible? Do I have to use some third-party tool? ...

"Recent documents" API in .NET?

For my document-based application I want to have a list of "Recent Documents", as many others do. I'm happy to implement this myself manually by writing to a settings file or whatever, but was wondering if there's a component in the .NET framework that will do this for me. Seems like a common function that many developers would need, a...

Post soap request and display response in vb2008.net?

I'm new to object oriented programming so I just need help on the basics here. I have an xml string that I've tested in a separate program and is able to communicate with my soap server correctly. I'm trying to add a request in Visual Basic 2008 to essentially take the soap string, send it as an http POST, and display the xml that is r...

Discover computers on local network with specific open port using .NET

I need to "discover" local computers running my windows WCF service, so I can talk to them. Right now you have to enter manually the ipaddress:port combination, but I would like to have a (web?) application that monitors the machines running the service and reports on it. When I try to connect to an invalid ip/port it takes "forever" t...

Why does System.Threading.Timer stop on its own?

Hi there, I'm doing a small test project before I use System.Threading.Timer in a Windows Service project. It's working wonderfully, however the timer stops on its own after a minute or two. The full source for the test project is: using System; using System.Windows.Forms; using System.Threading; namespace studyTimers { public pa...

How to allow only character valid in a Windows file system in a TextBox that can only appear as uppercase in Winforms?

Is there an easy way for this? About the set of characters allowed in a Windows file system (Char.IsLetterOrDigit is not enough) How do I make the characters that are typed as uppercase? ...

Refactor using generics

I have a simple interface with methods such as bool TryGetValue(string key, out string value); bool TryGetValue(string key, out int value); bool TryGetValue(string key, out double value); bool TryGetValue(string key, out DateTime value); // only value types allowed //with the implementation based on dicti...

Immutable Class Construction Design

So we all realize the benefits of immutable types, particularly in multithreaded scenarios. (Or at least we should all realize that; see e.g. System.String.) However, what I haven't seen is much discussion for creating immutable instances, specifically design guidelines. For example, suppose we want to have the following immutable cla...

Using ConfigurationManager to write to an external config file?

I've not been able to find any easy reference on this: I have a web.config file that specifies <appSettings file="someotherfile.config"/> to put settings in an external file. That means that someotherfile.config is not a "valid" configuration file, as it doesn't follow the full tree format, it just contains the appSettings subtree. Is ...

.NET API for Connecting to Bugzilla

I am looking for a library to connect to Bugzilla which works with C#. I did find the Bugzilla C# Proxy, but it's not quite what I'm looking for. I haven't been able to find anything else through Google searches. Does anybody have any other suggestions? Thanks. ...

WCF ServiceModelReg.exe erased system.serviceModel section in machine.config

The problem (after much head scratching) is fixed now, so I'm just trying to understand what went wrong with my WCF settings. I just had a problem where I ran ServiceModelReg.exe to fix some .svc handler mappings in IIS7 and started getting HTTP 500 errors and event log entries like this: WebHost failed to process a request. Sender Info...

Encryption to alphanumeric in System.Security.Cryptography

I have a project which requires encryption of customer ids. The encrypted value is used as a query string value for a website which then returns a personalized form for completion. The problem I'm having is that the website we are working with has a security policy which disallows non-alphanumeric characters from a query string. I'm...

C# List<T>.Find(x=>x.Rectangle.Contains(Point)) FAIL

For the life of me I can't make sense why this code produces the following output... I think there is a bug or something when using List and lambda if the type exposes a Rectangle property and you use the Contains method of the rectangle object...and explicit iteration proves true while the List Find method fails.... Oneway Code publ...

Comparing Hashtables in vb.net

I have a type of object called Bin, which has a hashtable field called Attributes. Like so: Public Class Bin Private _attributes As Hashtable Public Readonly Property Attributes() As Hashtable Get Return _attributes End Get End Property End Class If I have two bins, I'd like to compare if they...

how to set focus and launch the already running application on button click event in c#.net3.5?

i have been trying the code using mutex but im unable to open my exe after button click im successful in not making the multiple entries of the application on the taskbar at button click but my application is launched only when i close my form.. i want to launch my application on button click and if the application is already launched th...

Does stdout have limitations

I had problems with imagemagik convert and unicode filenames. I then wrote a echo.bat which simply does echo %1. What came back in stdout via .NET wasnt my unicode characters. Is there some kind of character limitation? I havent tested length of characters i can pass as an argument is there a limit on that? ...

VS confusing option: converting web-application to web-application

Could anyone explain, why is there an option to convert an Asp.Net Web-application (both Web Forms and MVC) to convert to a Web-application. This might be something of a help for web-site template but why for Web-application ? Is this Thanks ...