.net

How to translate a config.ini file into C#.NET objects

config.ini: [globalloads] plugin.SWPlugin = 1 plugin.SWPlugin.params.1 = true plugin.SWPlugin.params.2 = 10 [testz : globballoads] plugin.SWPlugin.params.2 = 20 plugin.SWAnotherPlugin = 1 Simple enough? // load testz config and programmatically create this equivalent code: SWPluginAbstract p = new SWPlugin(true, 20); // go thru the ...

Download link of "Google Contacts API version 3.0" for .NET.

Hi, I have 2.0 version of Contacts API. But i am looking for newer version "Contacts API version 3.0" for .NET . Can anyone send me download like for it thanx ...

How to safely store encryption key in a .NET assembly

In order to prevent somebody from grabbing my data easily, I cache data from my service as encrypted files (copy protection, basically). However, in order to do this, I must store the encryption key within the .NET assembly so it is able to encrypt and decrypt these files. Being aware of tools like Red Gate's .NET Reflector which can...

RegEx: Split String at Capitalized Letters and Non-capitalized letters to Create Small Cap Fonts

So i've purposefully stayed away from RegEx as just looking at it kills me...ugh. But now I need it and could really use some help to do this in .NET (C# or VB.NET). I need to split a string based on capitalization or lack thereof. For example: I'm not upPercase "I" "'m not up" "P" "ercase" or FBI Agent Winters...

How to highlight a control when selected?

How can I highlight an image when it is clicked and remove the highlight when the mouse is up? ...

Dev environment for smart client application

Hi, we are starting a new smart client project, which is .net winform as client, connecting web service at application server in win 2003. currently, all developers are using win xp pro, to enalbe debugging at both client and server side, we try to get both client and web service installed on XP pc, but the web server require service ac...

File.Move, why do i get a FileNotFoundException? The file exist...

Its extremely weird since the program is iterating the file! outfolder and infolder are both in H:/ my external HD using windows 7. The idea is to move all folders that only contain files with the extention db and svn-base. When i try to move the folder i get an exception. VS2010 tells me it cant find the folder specified in dir. This c...

Shared(Static) classes with events in C#

Here is an example of what i would do in vb: Public Class Class1 Public Shared WithEvents Something As New EventClass Public Shared Sub DoStuff() Handles Something.Test End Sub End Class Public Class EventClass Public Event Test() End Class Now how do i do this in c#. I know there is not handles clause in c# so i n...

.net Windows form binded with data, too slow

I have a windows application in which a form is binded with the data. The form loads slowly because of large data. I am also showing paging in form to navigate through the records. How to increase the performance? ...

Switch -Regex in Powershell.

$source |% { switch -regex ($_){ '\<'+$primaryKey+'\>(.+)\</'+$primaryKey+'\>' { $primaryKeyValue = $matches[1]; continue; } } I want to use dynamic key value with switch-regex, is that possible? ...

SOCKET chat C# with private messaging

I want to create SOCKET chat(server + clients) with private messaging. When client write smth to stream, he should notify server that it is private message for user X, how can i do this? Actually i can do smth like this: string command = "PRIV|" + txtMessage.Text; swSender.WriteLine(command); but i think it isn't good, for example...

What's the difference between GlobalProxySelection.Select and WebRequest.DefaultWebProxy?

What's the difference between GlobalProxySelection.Select and WebRequest.DefaultWebProxy? Seems like they are doing the exact same thing. ...

DefaultNetworkCredentials or DefaultCredentials

Which one am I supposed to use when I need to supply a credential to a proxy (local or in Network)? What's the exact difference between these two? ...

How are value types implemented in .NET

Been looking around the net and can't find any articles about how value types are actually implemented. For instance, an Int32 is a struct and it's direct parent is System.ValueType and that's ultimate parent is System.Object. Object is a class - I imagine ValueType is a class? What's the class hierarchy? What part does the CLR have to...

Option In The Html Agility Pack That Parse From The Tag `&lt table &lt`

Is there any option in the html agility pack that can parse the tag which is like in the &lt and &gt. If there is tag like <table> then html agility pack parse the information from the tag table properly.But if the tag is like &lt table &lt then it does not parse the information from the tag table here. So any option is there in the htm...

Does Silverlight 4 support drag and drop from app to desktop ?

I have seen that SL4 support drag and drop from the desktop to the application, but is it possible to drag and drop from the application to the desktop ? Thanks, ...

Exposing a .Net Service

I have written a Windows Service in .Net and I want to expose the classes to be called by other .Net code. Specifically, I have an API that I want to expose via a DLL that will be placed in the GAC, and I want the DLL in the GAC to use the classes of the .Net Windows Service. I need this architecture as the code in the Windows Service ...

Lock-free multi-threading is for real threading experts...

I was reading through an answer that Jon Skeet gave to a question and in it he mentioned this: As far as I'm concerned, lock-free multi-threading is for real threading experts, of which I'm not one. Its not the first time that I have heard this, but I find very few people talking about how you actually do it if you are interested i...

Using db4o with multiple application instances under medium trust

I recently stumbled over the object database engine db4o which I think looks really interesting. I would like to use it in an ASP.NET MVC application that will be deployed to a shared hosting environment under medium trust. Because of the trust level, I'm restricted to using db4o in embedded/in-process mode. That in itself should be no ...

PowerShell - Set Alias for Loaded Assembly

I use this code to load a .Net assembly to PowerShell: [System.Reflection.Assembly]::Load("System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089") | out-null [System.Windows.Forms.MessageBox]::Show("Hello world") Can I set an alias for an assembly (for example 'System.Windows.Forms' = 'Forms') so that...