.net

Why are some CLR languages called "visual"? (Visual C#, Visual Basic .NET, Visual C++)

I understand visual programming languages to be those languages that allow the programmer to to manipulate graphical--rather than textual--objects onscreen to build functionality. The closest thing I see in C#, VB, etc. is RAD controls, but that is just composing UI and the very simplest functionality -- it has nothing to do with the la...

MDI Forms in .NET 3.5

Is there any improvemens or new features in .NET 3.5 Windos Forms in creating MDI Forms as compared to .NET 2.0? ...

Setting the LastPasswordSet date for a user in Active Directory

I want to set the LastPasswordSet attribute of a user in Microsoft Active Directory. The .NET UserPrincipal API exposes the LastPasswordSet property as readonly. Is there a way around this, to set the value (perhaps using ADSI)? Edit: MSDN provides the following example code: usr.Properties["pwdLastSet"].Value = -1; // To turn on, ...

Need to determine if ELMAH is logging an unhandled exception or one raised by ErrorSignal.Raise()

I am using the Elmah Logged event in my Global.asax file to transfer users to a feedback form when an unhandled exception occurs. Sometimes I log other handled exceptions. For example: ErrorSignal.FromCurrentContext().Raise(new System.ApplicationException("Program code not found: " + Student.MostRecentApplication.ProgramCode)); // mo...

TFS state values

is there a way to retrieve possible state values for a workitem using .net api? ...

How do I move the cursor from the first textarea to a second textarea, without using tab or the mouse ?

I'm building a password box that holds three text areas. Each text area has one character. After I type the first character of the password, I have to press tab or use the mouse to get to the second text area to type the second character of the password. I would like to make this happen automatically (cursor movement) just right after I ...

SQL statements in separate file

Hello, I'm working on .net project and writing an application that interacts with database. I currently have some SQL statements in the code and I want to put these statements in separate file with solution. So, later when the application gets deployed, and if I want to update SQL statements, I could just update the statements in the ...

Alternatives to WPD/WIA on Windows XP?

WPD does not work correctly on Windows XP (SP1 if that matters), even if Microsoft states it does. Problem with WPD: IPortableDeviceManager.GetDevices call does not find any devices on Win XP while it finds all connected cameras on Windows 7. A few other people had this same problem with WPD not working on XP, no solution: 1 2 I hav...

How can I filter FieldInfos that are the underlying implementation of a class event ?

I want to get all the fields of a class without getting the underlying implementations of the class event. type.GetFields(BindingFlags...) returns the nuderlying delegate for event fields. Does anyone knows how to filter them out ? ...

c# Timespan to ISO8601 format string

Can anyone advise on how to convert a timespan or int to an ISO8601 duration string? 1hour and 30 minutes would result to PT1H30M e.g. int duration = 90; string isoString = duration.ToIsoDuration(); http://en.wikipedia.org/wiki/ISO_8601#Durations ...

XslCompiledTransform fails for XSLT with many xsl:when conditions

I'm just in the process of upgrading a ASP.Net 1.1 application up to .Net 3.5 and one of the changes I've made is to use XslCompiledTransform rather than XslTransform. I was running through some test XSLTs to ensure all was well when I found an XSLT that failed using the new method. After a bit of investigation I found that the XSLT had...

Windows Form Custome Tool: Combobox with Checkbox items

I need a control that acts like a combobox but has checkbox items in it. I don't see any tool like this. What's the best way to 'roll your own'? ...

Is passing a struct value to a method by-reference in C# an acceptable optimization?

Say I have a struct: struct MyStruct { public int X public int Y } And a method in some class that is iterated over many times elsewhere: public bool MyMethod( MyStruct myStruct ) { return ... } Is changing the MyMethod signature to the following an acceptable optimization? public bool MyMethod( ref MyStruct myStruct )...

use 1 class which exists in 2 references

In .NEt C# How can I tell the compiler to use a Type from a particular class when a second Type exists with the same name in my project references? A class I wish to use exists in 2 project references. The namespace etc is identical. I require both references in the project, but for this particular class I wish to use the one from one o...

What is your favorite convention for organizing a ASP.NET project?

Hello world. My team is starting a brand new ASP.NET solution which will probably become large. Inspired by ASP.NET MVC, we currently express all data access objects in a model project. We, however, do not have good conventions for organizing ASP.NET ascx's and aspx's. We have already reviewed DotNetNuke and want to avoid the com...

Undocumented overload of string.Split() ?

According to both Intellisense and MSDN doc on string.Split, there are no parameterless overloads of string.Split. Yet if I type in string[] foo = bar.Split(); It compiles. And it works. I have verified this in both Visual Studio 2008 and 2010. In both cases intellisense does not show the parameterless overload. Is there a reason...

How secure is WCF wsHttpBinding's Windows authentication?

I have created WCF and I have used wsHttpBinding and MTOM as message transport with authentcation as "Windows". Now my service is not current SECURE, its plain HTTP, running on custom port. Is Windows Authentication of WCF's wsHttpBinding secure? can anyone see the password or guess through network trace? Environment Information: H...

using python library in .net

is it possible to include a library created in python/php in a .net application. In this scenario the library handles authentication for an API. ...

Does the FileInfo.GetFiles method in .NET CF retrieve all files recursively?

I see .NET has the option: SearchOption.TopDirectoryOnly which helps me to limit the file list retrieval for just the selected directory, not subdirectories. I would like to know whether .NET CF has any options to do so? ...

Write to XmlDocumentType.Entities but ReadOnly?

I'm trying to change the value of an entity in a document's DocumentType.Entities XmlNamedNodeMap but according to MSDN, it's read-only. How can I set one of the entities? ...