.net

Distribution of MDI children in an MDI parent

Hi all I have an MDI parent form that creates many MDI children at run time. Is there a smart way to evenly ditribute these forms inside there parent? any ideas? Thanks in advance!! ...

ASP.NET MVC: Get lowercase links (instead of Camel Case)

All my dynamically generated action links etc. are creating links like /Account/Setup. It looks strange. I'd like all my links to be lowercase (meaning /account/setup). Any way to do this? ...

Calculating expression tree with many parameters

I'm trying to use the Expression tree and Lamdba Expression objects in .Net 3.5 to allow me to dynamically calculate boolean expression entered by a user. So far a user can create an expression tree consisting of BinarayExpressions that AND and OR values expressed as ParameterExpressions. I was then planning on creating a LambdaExpressi...

How to uniquely identify computer using C#?

How to uniquely identify computer (mainboard) using C#(.Net/Mono, local application)? Edition. We can identify mainboard in .Net using something like this (see Get Unique System Identifiers in C#): using System.Management; ... ManagementObjectSearcher searcher = new ManagementObjectSearcher("select * from Win32_MotherboardDevice"); .....

Singleton - if or try/catch ?

I've been sitting on this idea for quite a long time and would like to hear what you guys think about it. The standard idiom for writing a singleton is roughly as follows: public class A { ... private static A _instance; public static A Instance() { if(_instance == null) { _instance = new A(); } retu...

doing textwrap and dedent in Windows Powershell (or dotNet aka .net)

Background Python has "textwrap" and "dedent" functions. They do pretty much what you expect to any string you supply. textwrap.wrap(text[, width[, ...]]) Wraps the single paragraph in text (a string) so every line is at most width characters long. Returns a list of output lines, without final newlines. textwrap.dedent(tex...

VB.NET Memory Management

Update: I probably confused memory usage issues with the UI sharing same thread as the processing (as pointed out by MusiGenesis below). However regarding the Memory usage. I am still not able to find VB.net specific syntax, although people have pointed out some great .Net and C# information below (and if I were more versed in those te...

IIS http request authentication issue

Hello everyone, I am using VSTS 2008 + C# + .Net 3.5 + IIS 7.0 + ASP.Net. I have two IIS web site, site A and site B. When user request url http://sitea/abc.aspx, my ASP.Net code handler will authenticate user (using Forms authentication), and if authenticaiton passed, I will redirect user to http://siteb/bcd.aspx. My current issue is,...

Best and simple way to call .net assemblies in java

Hi guys, Exists a way to call .net assemblies more specific .dll files in java? I i'm developing a a framework for .net now i need to migrate it to java, i can do this? I using c# in .net. ...

Obfuscating Setup package content

I have a multi-project Visual Studio 2008 solution. I would like to obfuscate some of the project outputs before they are built into the Setup file using Dotfuscator. So I would like to be able to: Be able to select what to obfuscate Create a Setup package that contains the already obfuscated code Verify if the obfuscation was a succ...

Why does HttpWebRequest GetResponse block for such a long time?

I have some fairly simple code that uploads a photo or video to an endpoint (using HTTP PUT or POST). Every so often I see connection closed exceptions thrown, and in reality the photo/video was uploaded just fine, it's calling GetResponse where the exception occurs. One thing I've noticed is that GetResponse can take an awful long time...

SharePoint MOSS and .NET 3.5

Is .net 3.5 supported with MOSS 2007 Server? Anyone had any issues with it? ...

In ASP.NET, how to process data on both client side (javascript) and server side with the one form submission?

I have a scenario where I am using Google Map JavaScript API to process the address after user submits the form. However, I want to post result, that Google API returns back, to server side for further processing within the same form submission. How can I achieve this? Thanks in advance for your advice. ...

Why there is no base type of Number in c#?

Unlike in java why c# does not have a supertype of Number for Floats, Integers etc? Any reasoning behind avoiding Number in c#? ...

ASP MVC/Sharp-Architecture beginner - how do actions get domain entities as inputs?

I'm trying out sharp-architecture (and ASP.NET MVC) for a new project after being on the fringes of that community for a while and I'm a little confused. Following the standard entity template generation I created a class Message and I can list, create, edit and delete them. I'm looking at the Edit(Message) action and just can't for ...

Controller/Static State Class in WinForms Application - Where to put?

I'm writing a WinForms application and want to have an "MVC-Type" Design. Actually it's more MVP or MVVM,. The plan is to have a Central Controller which does all the actual work, so that the Forms just render out ViewModels and handle user input, but everything that actually does something goes through the Controller. I just wonder if...

Is Predicate<T> not available in .NET 3.0+

Is Predicate available anywhere in .NET? From MSDN http://msdn.microsoft.com/en-us/library/bfcke1bz.aspx, I don't see a Predicate anywhere. I see an anonymous that returns a boolean but no generics or a "Predicate" keyword. ...

Asynchronous methods and asynchronous delegates

C# 3.0 in a nutshell says asynchronous methods and asynchronous delegates looks similar but the behavior is very different. Here is what the book says about both. Asynchronous methods Rarely or never blocks any thread. Begin method may not immediately return to the caller. An agreed protocol with no C# language support. Asynchrono...

.NET Equivalent to DateJS

I like the different human readable strings you can parse with the DateJS javascript project (http://www.datejs.com/). I was wondering if anyone knew of any .NET library that could parse simiilar strings in .NET? ...

Single-threaded apartment - cannot instantiate ActiveX control

I need to get information about applied CSS styles in HTML page. I used AxWebBrowser and iterate IHTMLDOMNode. I'm able to get all the data I need and move the code into my application. The problem is that this part is running inside of the background worker and I got exception when trying to instantiate the control. AxWebBrowser browse...