.net

Using the .NET Framework security system

I was wondering - do any of you actually use the various classes in the System.Security.Permissions namespace? I mainly develop desktop/server-side components (i.e., no web) and the general assumption is that FullTrust is always available and no testing is performed on environments for which this is not the case. Apart from MS source c...

When should I use a List vs a LinkedList

When is it better to use a List(Of T) vs a LinkedList(Of T)? ...

How would you simplfy Entering and Exiting a ReaderWriterLock?

This seems very noisy to me. Five lines of overhead is just too much. m_Lock.EnterReadLock() Try Return m_List.Count Finally m_Lock.ExitReadLock() End Try So how would you simply this? ...

How would you simply Monitor.TryEnter

This is even worse than the ReaderWriterLock in terms of noise. If Threading.Monitor.TryEnter(syncRoot) Then Try 'do something Finally Threading.Monitor.Exit(syncRoot) End Try Else 'do something else End If Both C# and VB solutions are welcome. ...

what are strategies for shielding off web resources based on business logic

I have a scenario where I'm not really sure my approach is the best one, and I would appreciate feedback / suggestions. scenario: I have a bunch of flash based (swf) 'modules' which are hosted in my aspnet application. Each flash has it's own directory on the filesystem, which contains assets for the flash. Consider this simplified site...

Set a database value to null with a SqlCommand + parameters

I was previously taught today how to set parameters in a SQL query in .NET in this answer (click). Using parameters with values are fine, but when I try to set a field in the database to null I'm unsuccessful. Either the method thinks I am not setting a valid parameter or not specifying a parameter. e.g. Dim dc As New SqlCommand("UPDA...

How to improve garbage collection performance?

What kind of optimization patterns can be used to improve the performance of the garbage collector? My reason for asking is that I do a lot of embedded software using the Compact Framework. On slow devices the garbage collection can become a problem, and I would like to reduce the times the garbage collector kicks in, and when it does,...

Other than IronPython and F#, what other .NET languages might be useful?

After falling in love with F# after only reading the website, and having a friend convince me to try IronPython, what else is there aside from those already included with Visual Studio 2008? ...

What do you think of the direction C# is heading for compared to Java?

C# 3/3.5 includes a set of new features which Java does not support (linq, wwf, lambda expressions, etc). C# 1.0,1.1 and 2.0 was comparable to Java in many ways. What do you think of this? do you agree? Is this a good thing? What is the future for both these languages compared to each other? ...

Is the C# 2.0 to C# 3.0 transition worth it for this project?

I have read on Stack Overflow some people that have converting to C#2.0 to C#3, but is it really worth it? I have a project that is done at 75% before going in maintenance phase. I am asking to myself if it is worth it to switch to C#3.0? Update: The project will have a web interface now so before entering the maintenance phase we hav...

Trapping textChanged event in CommandBarComboBox

Hello, I'm writing an outlook add-in, which adds a toolbar with a button, and a combobox, of CommandBarComboBox type. As far as I can see, the only event which this control handles, is Change, which is going into effect only after pressing Enter/Tab. I want to handle the key presses as soon as the text changes, much like the the TextCh...

Rich Text in Windows Forms application

I would like to update a Windows Forms application to provide the following features: spell checking limited formatting of text: bold, italics, bulleted lists Ideally the formatted text could be accessed in a plain text way for reporting through tools that don't support the formatting, but could also be rendered as HTML for tools tha...

What's the best .NET library for parsing and generating Excel spreadsheets?

Open-source or not. What's your experience using it? How's the learning curve? ...

How can I get an OpenFileDialog in a custom control's property grid?

Hi community, I'm creating a .net custom control and it should be able to load multiple text files. I have a public property named ListFiles with those properties set : [Browsable(true), Category("Configuration"), Description("List of Files to Load")] public string ListFiles { get { return m_oList; } set { m_oList = value;...

Anyone really using Code Access Security to protect their assemblies and/or methods?

Seems to me most of developers completely ignore this features. People prefer handling security exceptions as generic ones relying on standard windows roles and rights instead of learning to use CAS ways of enhancing security - probably because CAS is quite confusing in its logic and naming. Can anyone suggest any general rule-of-thumb/...

Parsing T-SQL to Parameterize a Query

The application I am currently working on generates a lot of SQL inline queries. All generated SQL is then handed off to a database execution class. I want to write a parsing service for the data execution class that will take a query like this: SELECT field1, field2, field3 FROM tablename WHERE foo=1 AND bar="baz" and turn it into so...

Adobe Air and .NET

Hi, I Adobe Air completly JavaScript? Can't I use a .NET language like VB.NET or C#.NET? Thanks ...

Logging entry and exit of methods along with parameters automagically?

Is there a way for me to add logging so that entering and exiting methods gets logged along with parameters automatically somehow for tracing purposes? How would I do so? I am using Log4Net. ...

Accessing internal members via System.Reflection?

I'm trying to Unit Test a class that has many internal functions. These obviously need testing too, but my Tests project is seperate, mainly because it covers many small, related projects. What I have so far is: FieldInfo[] _fields = typeof(ButtonedForm.TitleButton).GetFields( BindingFlags.NonPublic | BindingFlags.Instance ...

c# store user settings in database

Is there an easy method to store a person's user settings in a sql 2000 database. Ideally all settings in one field so I don't keep having to edit the table every time I add a setting. I am thinking along the lines of serialize a settings class if anyone has an example. The reason I don't want to use the built in .NET user settings stor...