tagged [.net-2.0]

AES 256 encryption in .NET Framework 2.0

AES 256 encryption in .NET Framework 2.0 Does anyone know if C# can be used in .NET Framework 2.0 to use AES 256 encryption and decryption? Appreciate if the in-built framework supports this or if we ...

20 Dec at 08:47

Watermark in System.Windows.Forms.TextBox

Watermark in System.Windows.Forms.TextBox What is he best way to implement Watermark functionality for a `System.Windows.Forms.TextBox` in .Net 2.0 with C#? --- Edit: Using the ready-made component fr...

14 Feb at 15:14

MVP Framework for winforms

MVP Framework for winforms i'm working in a new project and i want to implement MVP pattern. There is a framework for winforms that use this pattern? I checked CAB but my project isn't complex to impl...

21 Oct at 07:33

How do you set a DateTimePicker to be read only?

How do you set a DateTimePicker to be read only? I have a DateTimePicker (nullable version) that I need to be read only. I'm not happy with the display if it is disabled, so wanted to know if anyone h...

18 Mar at 12:7

How do I determine which monitor my winform is in?

How do I determine which monitor my winform is in? I have been up and down this site and found a lot of info on the Screen class and how to count the number of monitors and such but how do I determine...

3 Dec at 00:12

TimeSpan using a nullable date

TimeSpan using a nullable date How can I subtract two dates when one of them is nullable? ``` public static int NumberOfWeeksOnPlan(User user) { DateTime? planStartDate = user.PlanStartDate; // user...

22 Nov at 21:11

How to tell if the OS is Windows XP or higher?

How to tell if the OS is Windows XP or higher? I am trying to play with the `Environment.OSVersion.Version` object and can't really tell what version would indicate that the OS is Windows XP or higher...

24 Mar at 06:37

How to generate an 401 error programmatically in an ASP.NET page

How to generate an 401 error programmatically in an ASP.NET page As you can see this is a question from a non web developer. I would like to have an ASPX page which, under certain circumstances, can g...

4 Apr at 12:18

How to fail a test that is stuck in an infinite loop?

How to fail a test that is stuck in an infinite loop? I have some code that produces an infinite loop. Now I need to write a test that will fail after about 200ms. 200ms will indicate that the code is...

11 Oct at 15:16

How to migrate a .NET Windows Service application to Linux using mono?

How to migrate a .NET Windows Service application to Linux using mono? What would be the best approach to migrate a .NET Windows Service to Linux using mono? I've been trying to avoid executing the ap...

12 Mar at 10:7

Check if object is NOT of type (!= equivalent for "IS") - C#

Check if object is NOT of type (!= equivalent for "IS") - C# This works just fine: Is there a way to check if sender is NOT a TextBox, some kind of an equivalent of != for "is"? Please, don't suggest ...

3 Jul at 16:34

Running .net based application without .NET Framework

Running .net based application without .NET Framework Is there a way to run .net based applications without .net framework installed. Is there a way to do this. Is there a software that can achive thi...

2 Jan at 02:22

How to convert a String[] to int[] in C# and .NET 2.0?

How to convert a String[] to int[] in C# and .NET 2.0? I've got : And I want something like this I work int C# .net v2.0, I don't want to write a lot of code. How can I do that? Thank you.

8 Dec at 13:24

How can I expose only a fragment of IList<>?

How can I expose only a fragment of IList? I have a class property exposing an internal IList through How can I pass a part of this `ReadOnlyCollection` without copying elements into a new array (I ne...

How do I select all items in a listbox on checkbox checked?

How do I select all items in a listbox on checkbox checked? I need to select all items in a ListBox when a CheckBox is clicked. Is it possible to select all items in the ListBox using a single line of...

13 Mar at 14:6

file exists by file name pattern

file exists by file name pattern I am using: What I would like to do is swop this out for a pattern, because the first part of the filename changes. For example: the file could be How can I check if t...

26 Dec at 19:52

parsing email text reply/forward

parsing email text reply/forward I am creating a web based email client using c# asp.net. What is confusing is that various email clients seem to add the original text in alot of different ways when r...

11 Mar at 11:11

How do we check whether any item in the listbox is selected in ASP.NET 2.0?

How do we check whether any item in the listbox is selected in ASP.NET 2.0? I have to do a for loop and check whether any of the items are checked if I want to know if any of the items are checked. In...

13 Mar at 14:8

two different DLL with same namespace

two different DLL with same namespace I have two DLL files that have the same namespace but they have different methods and types. How can I reference both DLLs in my project and use their methods and...

14 Aug at 13:39

Reserved Keyword in Enumeration in C#

Reserved Keyword in Enumeration in C# I would like to use `as` and `is` as members of an enumeration. I know that this is possible in VB.NET to write it like this: How do I write the equivalent statem...

14 Jul at 01:38

How to unit test if my object is really serializable?

How to unit test if my object is really serializable? I am using C# 2.0 with Nunit Test. I have some object that needs to be serialized. These objects are quite complex (inheritance at different level...

How to call a VBScript file in a C# application?

How to call a VBScript file in a C# application? I need to call a [VBScript](http://en.wikipedia.org/wiki/VBScript) file (.vbs file extension) in my C# Windows application. How can I do this? There is...

20 Feb at 13:44

WaitCursor on sort in DataGridView

WaitCursor on sort in DataGridView I am using the standard .Net 2.0 DataGridView with sort mode of automatic on the column. It is very very slow (which should probably be another question on how to sp...

11 Nov at 16:36

Allow multi-select in a .NET TreeView

Allow multi-select in a .NET TreeView I'm stuck in .NET 2.0 Windows Forms. It doesn't look like the ability to select multiple nodes exists in the standard `TreeView` control. I'm trying to do this fo...

18 Aug at 12:23

Creating a delegate type inside a method

Creating a delegate type inside a method I want to create a delegate type in C# inside a method for the purpose of creating Anonymous methods. For example: Unfortunately, I cannot do it using .NET 2.

18 Nov at 15:54