.net

Why 10675199.02:48:05.4775807 TimeSpan Maximum for CompilationSection?

I was looking at the metadata for System.Web.Configuration.CompilationSection, and noticed the following attribute on the TimeSpan BatchTimeout property: [TimeSpanValidator(MinValueString = "00:00:00", MaxValueString = "10675199.02:48:05.4775807")] Could someone explain why this is the allowed max value? TimeSpan itself has an upper...

Can you get a Func<T> (or similar) from a MethodInfo object?

UPDATE: The suggestion to use an expression tree to construct a lambda using the given MethodInfo, in conjunction with the Expression<TDelegate>.Compile method, proved to be a gold mine in my scenario. In the specific case where I was toying with this idea, I saw average execution time for a particular method go from ~0.25 ms to ~0.001 m...

C#, .NET, PInvoke For registry functions and PInvoke, how do i get the data from handle pointers?

Say i am using RegQueryValueEx: http://msdn.microsoft.com/en-us/library/ms724911(v=VS.85).aspx I can get the pointer handle to lpType, but its just an integer, how do i actually get the data lpType is pointing to? ...

Developing "Command Line" in .NET?

Imagine a "search box" on the right top side of the UI Windows Application. When user types a desired action, a matching functionality is executed. Screen gets opened, or action gets performed. For example: user types "create" and intellisence offered next word options "client"/"product", user picks "client", and "Create New Client" sc...

SelectionChanged event binding in Silverlight+MVVM-Light

The handler of the "SelectionChanged" event of the ComboBox control has the following signature: void SelectionChangedMethod(object sender, SelectionChangedEventArgs e) How to bind to that property under Silverlight 4 and MVVM-Light to the corresponding method of the ViewModel object? As far as I know, I need to do something like thi...

A Solution For (IEnumerable<Base>)Derive; Yet?

Possible Duplicate: C# Cannot convert from IEnumerable<Base> to IEnumerable<Derived> I have D1 and D2 which derive from B. When i write var ls = (IEnumerable<B>)(cond?lsD1:lsD2); I get a runtime cast error. IIRC this is a well known problem. My question is 1) Is this allowed yet? perhaps in .NET 4? I have 2010 but my project ...

Is there any software made by microsoft using .NET?

I've been reading some blogs and articles lately and one thing I noticed a couple of times was authors stating that Microsoft 'doesn't use their own technologies' with respect to developing applications using the .NET framework (specifically, desktop applications). There's not a whole lot of information that I can see as to what platfor...

How to set DateTimePicker to auto update?

Hi, I've added a date time picker to a form. Initially its value is set to the DB sever date and time. Once its value is set, I need it to automatically update itself so that it always shows the DB server Date and time. How can I do this? Do I have to develop a custom control? Thanks in advance! ...

About redirected stdout in System.Diagnostics.Process

I've been recently working on a program that convert flac files to mp3 in C# using flac.exe and lame.exe, here are the code that do the job: ProcessStartInfo piFlac = new ProcessStartInfo( "flac.exe" ); piFlac.CreateNoWindow = true; piFlac.UseShellExecute = false; piFlac.RedirectStandardOutput = true; piFlac.Arguments = string.Format( f...

Something about Stream

I've been working on something that make use of streams and I found myself not clear about some stream concepts( you can also view another question posted by me at http://stackoverflow.com/questions/2933923/about-redirected-stdout-in-system-diagnostics-process ). 1.how do you indicate that you have finished writing a stream, writing som...

How to prevent from misclose browsers

I have a Web Application and I want to get a confirmation from users when they are closing the application no matter what. I mean I'm looking for a way to display a message touser whenever user try to close the application. Update : I want to use my dialog box not browsers dialogbox. r at least a dialogbox which only shows my messa...

FromBase64String Method maximum length

FromBase64String Method maximum length ...

Single Responsibility Principle usage how can i call sub method correctly?

i try to learn SOLID prencibles. i writed two type of code style. which one is : 1)Single Responsibility Principle_2.cs : if you look main program all instance generated from interface 1)Single Responsibility Principle_3.cs : if you look main program all instance genareted from normal class My question: which one is correct usage? whic...

How to list all managed objects in heap in .Net?

Hi, is it possible to list all objects stored in heap. I would like to do something like this: IEnumerable<GCHandle> listOfObjectsInHeap = GetListOfObjectsFromHeap(); ...

Why do i get E_ACCESSDENIED when reading public shortcuts through Shell32?

I'm trying to read the targets of all desktop shortcuts in a C# 4 application. The shortcuts on a windows desktop can come from more that one location, depending on whether the shortcut is created for all users or just the current user. In this specific case I'm trying to read a shortcut from the public desktop, e.g. from C:\Users\Public...

Update Statement Updates 0 Rows via the C# Winform Application?

First of all, please help me out! I can not take this anymore. I could not find where the error is located. Here is my problem: I'm trying to update a row via c# winform application. The update query generated from the application is formatted correctly. I tested it in the sql server environment, it worked well. When i run it from the a...

CLS allows private portions of the code in classes to be non CLS compliant. How is this possible ?

CLS allows private portions of the code in classes to be non CLS compliant. How is this possible, because ultimately the code needs to be converted to the IL ? ...

Setting System.Drawing.Color through .NET COM Interop

I am trying to use Aspose.Words library through COM Interop. There is one critical problem: I cannot set color. It is supposed to work by assigning to DocumentBuilder.Font.Color, but when I try to do it I get OLE error 0x80131509. My problem is pretty much like this one. update: Code Sample: from win32com.client import Dispatch Doc = ...

Network Connectivity using System.Net.Sockets.TcpClient

Hi, Can we use tcpClient to test the network connectivity between the two different servers other than where the programe will run. Regards ...

MPAPI vs MPI.NET vs ?

I'm working on college project. I have to develop distributed computing system. And i decided to do some research to make this task fun :) I've found MPAPI and MPI.NET libraries. Yes, they are .NET libraries(Mono, in my case). Why .NET ? I'm choosing between Ada, C++ and C# so to i've choosed C# because of lower development time. I have...