.net

AppFabric Cache - An existing connection was forcibly closed by the remote host

I'm trying to get AppFabric cache up and running on my local development environment. I have Windows Server AppFabric Beta 2 Refresh installed, and the cache cluster and host configured and started running on Windows 7 64-bit. I'm running my MVC2 website in a local IIS website under a v4.0 app pool in integrated mode. HostName : CacheP...

Adaptive windows mobile application

What is a good approach to write a windows mobile app that can run on different device, screen resolution, screen size? In my mind, I'd like to write the form once and be adaptive. But I'm hearing sometimes that you write the form for different form factors, different screen size, different orientation (portrait/landscape) .... I just...

How to use reflection to call a method and pass parameters whose types are unknown at compile time?

I'd like to call methods of a class dynamically with parameter values that are "parsed" from a string input. For example: I'd like to call the following program with these commands: c:>myprog.exe MethodA System.Int32 777 c:>myprog.exe MethodA System.float 23.17 c:>myprog.exe MethodB System.Int32& 777 c:>myprog.exe MethodC System.Int...

Is there equivalences between Microsoft and Oracle/Sun technologies?

Hello is it possible to say what are the Microsoft equivalents technologies compared to Sun? For example: Microsoft | Oracle/Sun --------------------------------------------------------------- Visual Studio | JDeveloper,NetBeans //thanks justin,danswain IIS ...

Reflective Generic Detection

Trying to find out if a provided Type is of a given generic type (with any generic types inside) Let me Explain: bool IsOfGenericType(Type baseType, Type sampleType) { /// ... } Such that: IsOfGenericType(typeof(Dictionary<,>), typeof(Dictionary<string, int>)); // True IsOfGenericType(typeof(IDictionary<,>), typeof(Dictionary<st...

Populating the PrimaryIdentity in WCF

Hi, I'm using simple HTTP headers to pass a token to a WCF service for authentication (The WCF service is required to use the basicHTTPBinding, so I unfortunately cannot use the canned ws-security implementation). I would like to populate the PrimaryIdentity object so the WCF services can examine it to determine the authenticated user. ...

With cacheduration set, is it possible to have the function still trigger

If I have my cacheduration set to some value for my Web Service, is it possible to force the function to trigger? Thanks. ...

asp.net regex to find anchor tags and replace their url

Hi -i'm trying to find all the anchor tags and appending the href value with a variable. for example <a href="/page.aspx">link</a> will become <a href="/page.aspx?id=2"> <A hRef='http://www.google.com'&gt;&lt;img src='pic.jpg'></a> will become <A hRef='http://www.google.com?id=2'&gt;&lt;img src='pic.jpg'></a> I'm able to match all th...

Is it possible to cancel a BeginRead on a NamedPipeServerStream without closing the pipe?

What the title says, really. I have a named pipe. I would like to attempt a read, but if it doesn't succeed after a timeout I'd like to still be able to use the pipe afterwards. Is this possible with NamedPipeServerStream, or do I have to rethink the entire approach? So far the only way I've found of cancelling a BeginRead is by dispo...

.NET Setting a cookie in a WebBrowser control

I am loading a website using a WebBrowser's Navigate function, and I want the browser to load the page with a cookie I've given it. The following code doesn't work: wb.Navigate(url, null, null, "Cookie: " + cookie + "\n"); What am I doing wrong? Will I have to use InternetSetCookie? This doesn't seem like the best solution....

Exist on .NET any way to detect if a Monitor with VGA plug is still plugged-in?

That's all, I want to know if someone unplug the monitor and take several actions, any idea? Thank you ...

Problem with inheritance and List<>

I have an abstract class called Grouping. I have a subclass called GroupingNNA. public class GroupingNNA : Grouping { // blah blah blah } I have a List that contains items of type GroupingNNA, but is actually declared to contain items of type Grouping. List<Grouping> lstGroupings = new List<Grouping>(); lstGroupings.Add( new Grou...

How to create simpliest PHP Get API with UTF-8 support?

How to create simpliest *(less lines of code, less strange words) PHP Get API *(so any programm made in .Net C# could call url like http://localhost/api.php?astring=your_utf-8_string&amp;bstring=your_utf-8_string ) with UTF-8 support? What I need Is PHP API with one function - concatinate 2 strings so that a simple .net client like thi...

NVelocity (or Velocity) as a stand-alone formula evaluator

I am using NVelocity in my application to generate html emails. My application has an event-driven model, where saving and/or updating of objects causes these emails to be sent out. Each event can trigger zero, one or multiple multiple emails. I want to be able to configure which emails get sent out at run-time without having to modify...

Why does Windows Explorer search freeze when I have an unrelated program paused in a debugger

While debugging my program, whether it's an ASP.NET application or a .NET console EXE and I have the debugger paused at a breakpoint I try to find a file in Windows Explorer. Either pressing WinKey+F or selecting search from the context menu freezes Windows Explorer - until I resume the program being debugged. My program has nothing to ...

How to remove BBCode from a string in .Net

I'm trying to remove all BBCode Tags from a string. [url]www.google.com[/url] becomes www.google.com I have a regex that works in php to find them all, just dont know how to remove them in .net RegEx to Find BBCode |[[\/\!]*?[^\[\]]*?]|si ...

How to break this string and sort on version number

I have an ASP app that has a string array as such (there are much more than this): 7.5.0.17 Date: 05_03_10 7.5.0.18 Date: 05_03_10 7.5.0.19 Date: 05_04_10 7.5.0.2 Date: 02_19_10 7.5.0.20 Date: 05_06_10 7.5.0.3 Date: 02_26_10 7.5.0.4 Date: 03_02_10 7.5.0.5 Date: 03_08_10 7.5.0.6 Date: 03_12_10 7.5....

Window's menu from .Net

How do I display a common window's menu from .Net code, the one that appears when Alt+Space is pressed? ...

How to get currently adding item to SPList from SPItemEventProperties inside event handler?

Hi, I'm using ItemAdding Event for one of my SPLists. The question is how I can get the new not yet added item from SPItemEventProperties? I've tried to ListItem.Item but the debuger shows that the property is set to Nothing. Any correction suggest? Best Regards T.S. ...

How this looping works in c#

Recently, in a book i read this code. Can you define the means of this code and how this code works. int i = 0; for (; i != 10; ) { Console.WriteLine(i); i++; } ...