.net

String encryption in a .NET assembly

Possible Duplicate : Free obfuscation tools for .NET Are there any free tools similar to Dotfuscator? I want to encrypt or obfuscate certain strings inside my .NET assembly. ...

Tool to explore GUI controls of a running .NET application needed

Is there any tool to explore properties of GUI controls (such as "Text" or "Location") from a running .NET application? ...

How do I convert an ascii code to the escaped 'screen friendly' view?

In C# .Net I'm looking to convert an ascii value (13, 16 etc) to its escaped view (eg \n, \r, \t etc) for a selector. Is there a built in way to do this or do I have to resort to using a look up table? ...

read string from .resx file in C#

Hi How to read the string from .resx file in c#? please send me guidelines . step by step ...

Why is my WebBrowser component using IE proxy settings despite changing the DefaultWebProxy?

In the program I am maintaining, the user can set their own proxy settings, in which case the DefaultWebProxy is set to a new proxy with those settings, in the case that they don't DefaultWebProxy is set to null. However, if I set duff proxy settings in internet explorer, the WebBrowser stops working, sending any navigation requests to ...

CryptographicException on Decryption

Hi All, Just wanna confirm my thoughts about CryptographicException on decryption. I have some tests, exactly the one with wrong passphraze. This test throws System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed. I was looking what would cause this. However I could not find anything. It leads ...

Datagrid checkbox cell

I have developed a Windows Forms application and it has a datagrid with checkbox. If I press a button then I want to get all checked rows and do some operation on them. The problem is that when button is pressed it does not recognize the latest checkbox action. It is like one step behind. My code is: private void copyToToolStripMen...

Setting a socket's local endpoint.

Hi, I need to create a socket which connects to a server process, but must be restricted to using a specified local adapter. The default behaviour is to use whatever it can, but I need to make sure that a given socket only tries (for example), the LAN connection, if both wifi and LAN are available. I am using C# and .NET 2.0. Cheers ...

Reading CSS files in .NET

Is there a class in .NET for reading CSS files? I guess it would be the equivalent of what the XmlDocument class is to an XML file. ...

Can I target Silverlight 3.0 using NAnt?

How can I add a silverlight-3.0 target framework to NAnt? I tried modifying the nant.exe.config file, based on silverlight-2.0 profile, but that fails during compilation with CS0518: Type "System.Object" not defined or imported [error message translated from Polish]. Also, the silverlight-2.0 target does not seem to set "SILVERIGHT" cond...

WSE3003: The certificate's trust chain could not be verified

I am writing a system that consumes a public web service. I'm consuming the web service using VS2008 and classic .NET Framework 2.0 Web Services technology. My problem is not consuming the web service or calling it's operations. The problem is when I get the response back from the operation it is signed and behind-the-scenes the generat...

[C#] How to make a web bot? (or something)

I need to register to a site programmatically. I did it with VB6 (using the IE Web Browser component), but I don't know how to edit textboxes on a website using WebBrowser. I don't need to do it with Webbrowser, it's just that I know it can be done with it. I just need to insert a username, a password etc. using my program. Thanks ...

How can I emit a .NET type with two properties that are overloaded only on return type?

I need to create a type that has two properties with the same name, and only differ on return type. Dynamically emitting this type via reflection is perfectly acceptable. Something like this: public TypeA Prop { get; } public TypeB Prop { get; } I do understand that I cannot consume this property from C# or VB.NET or lots of other .N...

WCF Service Self Hosting Trouble

I'm trying to host a WCF Service inside a Windows Service which I am starting through a console app. Each service is its own project as is the console app. I've copied the app.config from the WCF Service library into the app.config of the console app, but I keep getting "Service has zero application endpoints...". I've read in a few p...

Implementing custom logging of WCF messages client-side

A collegue of mine needs to implement custom logging of WCF messages, for debugging purposes, but also for traceability (logged data will be saved for future reference and verification). Examples like this one, Capture XML In WCF Service, shows how to do this for the host, but he needs it for the client application. Can anyone help me/...

Is it possible to extend the "Analyze" feature of Reflector?

Hi There, Does anyone know if it's possible to extend the analyze functionality of Reflector? When you select a type and click "Analyze" and then in that analyze window you get the options of "Depends On", "Used By", "Exposed By" or "Instantiated By". I would like to get that output and send it to a file. Thanks in advance, Allan ...

Creating objects using Unity Resolve with extra parameters

I'm using Prism, which gives be the nice Unity IoC container too. I'm new to the concept, so I haven't gotten my hands all around it yet. What I want to do now is to create an object using the IoC container, but passing an extra parameter too. Allow me to explain with an example..: I have a class that takes a commands object. This is r...

Multi-line regex search in whole file

I've found loads of examples on to to replace text in files using regex. However it all boils down to two versions: 1. Iterate over all lines in the file and apply regex to each single line 2. Load the whole file. No. 2 Is not feasible using "my" files - they're about 2GiB... As to No. 1: Currently this is my approach, however I was won...

C#: Linq style "For Each"

Possible Duplicate: Linq equivalent of foreach for IEnumerable Is there any linq style syntax for "For each" operations? For instance, add values based on one collection to another, already existing one: IEnumerable<int> someValues = new List<int>() { 1, 2, 3 }; IList<int> list = new List<int>(); someValues.ForEach(x => list....

How to properly store state in a C# .Net application

I have a list of objects, where each object has a boolean property named "enabled". I want to remember the state of these objects accross application sessions. To do this I have at least 2 options, using the registry or using, the more .net approach, app.config file. I would prefer to do the latter. However, while static/compiletime ...