.net

Integrating a .Net service with Microsoft Exchange

Are there any API's for integrating a server side application with Microsoft Exchange? I have a server application that needs to read contact/prospect information entered into exchange via Outlook. What's the best approach? Outlook automation, or is there some sort of API I can use? My environment is .Net/C#. Any tips appreciated. ...

Is it possible to override parameter values when using Method Injection with Unity?

Hi there, It says in the Unity manual... ParameterOverride can be used only for constructors. So why are the parameters of methods left out? Cheers, Ian. ...

Difference between page_load and onLoad

What is difference between page_load and onLoad functions in ASP.NET codebehind? ...

Casting an Object type to DataRow & IDatareader

Casting an Object type to DataRow & IDatareader ...

Validating UK Post Codes using regular expressions.

I want to validate a field with a UK Post Code. What regular expression could be used to validate this field?. (([A-Z]{1,2}[0-9][0-9A-Z]{0,1})\ ([0-9][A-Z]{2}))|(GIR\ 0AA)$ does appear valid because it has the exception GIR 0AA. So, please help me to write an expression without any exception ...

How to Map a Drive using C#?

How can I map a network drive using C#. I don't want to use net use or any third party API. Heard about UNC paths in C# code but not quite sure how to go about it. ...

How to serialize two object with `one-to-many` relationship?

I have two classes: Lookup and LookupItem that Lookup has a member named Items that is a collection of LookupItems. I'm not able to serialize Lookup or LookupItem. With the first I get error The type LookupItem was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically. and with the secon...

what's the use of string.Clone() ?

there are 2 examples of code: # 1 string str1 = "hello"; string str2 = str1; //reference to the same string str1 = "bye"; //new string created and # 2 string str3 = "hello"; string str4 = (string)str3.Clone();//reference to the same string str3 = "bye";//new string created looks like they are identical aren't they? so what is ...

How to inject a base class to a proxy using DynamicProxy?

I would like to inject a base class to any proxy class with a an attribute. For example: public class Base { } [SomeAttribute()] public class Foo { } public class Bar { } If Foo doesn't inherit from base, inject it however Bar shouldn't be injected with base. Anyone got a clue? ...

Problem with dynamic loading XAP files with MEF. IE is crashing.

Hello, i am having a huge problem with MEF when i am trying to dynamic load XAP files. When i am download the catalog/xap file with the the method call dc.DownloadAsync(); My Internet explorer will crash and show me the "IE has stopped working" dialog. (see image belove). I have followed several steps by steps guides and i just cant see...

Unordered threads problem

I had asked question about lock in here and people responded there is no problem in my lock implementation. But i catched problem. Here is same lock implementation and i am getting weird result. I expect to see numbers starts from 1 but it starts from 5.Example is at below. class Program { static object locker = new object(); st...

Is there a .Net (prefer F# or C#) implementation of the Hilbert-Huang Transform?

Hilbert-Huang Transform, Empirical Mode Decomposition... I have found it implemented in R and Matlab. I'd like to find an open source implementation of it in C#/F#/.NET. ...

How do I change all the build directories in my VS solution?

I've got a solution with dozens of projects. I can individually go into the nice "Properties" tab and change the output directories there, but that would take ages. What's the fast way? Also, there are some old build configurations that are no longer required. How do I zap them? ...

Writing a proxy to listen for information traveling from client to service

I need to write an application that acts as a proxy between a client and a service. All I want to do is read the data that is traveling in both directions from client to service and vice versa. In essence I want this proxy to be able to be just plugged in without the need to reconfigure port settings in either the client or the service. ...

How I will use the following static variable from other class?

I have a class like following: public class Trainee { private static int numberOfTrainee = 30; private string traineeName; private string tarineeId; } Now I want to access the static data "numberOfTrainee" in the following class without creating a object of "Trainee" class and I don't want to write getter for "numberOfTr...

Strange behavior of ThreadStatic

I have the code: internal static class IdCounter { [ThreadStatic] private static int _id = 0; static IdCounter() { } public static int Id { get { lock(typeof(IdCounter)) { return _id++; } } } } public abstract class Request { ...

Forms.WebBrowser strange behavour

I have a Webbrowser control that I am using to generate thumbnails of web pages. Below is my code: webBrowser.AllowNavigation = true; webBrowser.Navigate(@"about:blank"); webBrowser.DocumentText = url; if (webBrowser.Document != null) webBrowser.Document.Write(url); Where url is a string containing the html. Using the above code r...

How to set keep alive interval for HTTP connection in WCF

Http transport channel in WCF uses persistent HTTP connections by default. How to control keep alive timeout for those connections? Default value is 100s. I found that value by monitoring application in Procmon. I haven't found any setting in http transport binding element which configures this timeout. Is there any .NET class which can ...

What's your favourite linq method or 'trick'

Hi All, I know it's a highly subjective issue (and one that may well see a flurry of 'close it' votes), hence pointing it at the CW and adding the disclaimer. Anyway, I've been working thro a project in asp.net mvc using subsonic and was suddenly (again) struck with the elegence and 'ruggedness' of the linq implementation that lies on...

Controlling FTP Accounts with .NET

Does anyone know how to control IIS (7.0+) from C#.NET? I want to create and FTP site and then create an FTP users which has read and write access on different folders? Is there some sort of library I can user for this? Thank you ...