.net

Concurrency issues while accessing data via reflection in C#

I'm currently writing a library that can be used to show the internal state of some running code (mainly fields and properties both public and private). Objects are accessed in a different thread to put their info into a window for the user to see. The problem is, there are times while I'm walking a long IList in which its structure may ...

Optimum file buffer read size?

I am writing an application which needs to read fairly large files. I have always wondered what's the optimum size for the read buffer on a modern Windows XP computer. I googled and found many examples which had 1024 as the optimum size. Here is a snippet of what I mean: long pointer = 0; buffer = new byte[1024]; // What's a good size...

HashSet that preserves ordering

I need a HashSet that preserves insertion ordering, are there any implementations of this in the framework? ...

Cast from filtered custom List<T> with LINQ

I have a custom list which inherits from Generic.List<T> like this: public class TransferFileList<T> : List<TransferFile> { .. } When I set (where 'Files' is a TransferFileList<T>): var files = uploadResponse.Files.Where(x => !x.Success).ToList() the 'files' object resolves as System.Collections.Generic.List<TransferFile>, not Tran...

Determine Genuine Windows Installation in C#

If I wanted to determine if a user had a genuine copy of windows, how could I do that in C#? Can I integrate with Windows Genuine Advantage? ...

Display pdf file in listview thumbnail C# 2008

How to display the pdf files in the listview thumbnail. I added the components in the tool box, adobe pdf reader. ...

Roughly, what percentage of "normal" users have .NET 3.5 installed?

When programming a new application, one of the first choices is deciding what .NET framework to target. What portion of average folks have .NET 3.5 installed. Stated more precisely, roughly what percentage of all computer users (or North American users if that is more readily available) currently have .NET 3.5 installed. An accuracy of ...

Bitmap region is already locked, multi-threaded environment

I'm working in an API that calls the main function through multiple threads. I'm trying to access through that function a Bitmap in another class and write from it, but even after setting it to use completely different instance of the object I am experiencing an InvalidOperationException: Bitmap region is already locked. I've tried lo...

Can't close certain processes with AutoHotkey

I'm having trouble creating a small AutoHotkey script to end all vsjitdebugger.exe processes on a test server. Here's the code I have: Process, Exist, vsjitdebugger.exe NewPID = %ErrorLevel% if NewPID = 0 { MsgBox Process doesnt exist } else { MsgBox Process exists } Process, WaitClose, vsjitdebugger.exe, 5 NewPID = %ErrorLeve...

What is difference between array and ArrayList?

I have a doubt that what is an array and what is an ArrayList? What is the different between them? ...

How to use threadpool class in .net compact framework with c# ( c sharp )?

Hi, i am looking for the solution for multi threading in c# .net compact framework. though threadpool class is good solution but is there any way to sync them like WaitHandle.WaitAll in compact framework? ...

symbol issue when debugging C# code

Hello everyone, I am using Windbg to load a crash dump from managed code (C#, a console application built for Any CPU), and crash dump is created on x64 platform. I am debugging on x64 platform. I have put the related pdb file into symbol path. But Windbg always find the symbol from a strange folder, here is an example (when I got from ...

how to write an xml file in flash( with dotnet frame work)

hi, i am trying to develop an flash application. where they have designed the entire front end by flash. now i need to doing the functionality part like taking the data from flash and save in database(sqlserver r mysql) using ( asp.net 3.5 frame work) . now as flash is able to read xml file there is...

Solution file is not visible once I create a website or project

Hi, I have installed VS 2005 newly.I tried to create a new three tier application. 1) First I added a new blank solution 2) Then I right clicked on the solution and added a new web site 3) once the new web site is created the solution file is not visible because of this reason I am not able to add the new project to the same soluti...

private symbol loaded but no line number displayed?

Hello everyone, I am using Windbg to load a crash dump from managed code (C#, a console application built for Any CPU), and crash dump is created on x64 platform. I am debugging on x64 platform. I have using the following command to load private symbol of my application. Here are what the commands I am using in Windbg. (set symbol pat...

Building a map simulation system

Hi guys, I'm currently working on a project that simulates a map with routes on it that allows users to decide their destination, and the system will calculate the shortest path to it. The map should receives real-time traffic data in which the traffic flow changes along the way while the vehicle is travelling. When the traffic flow chan...

Unit Testing and SharePoint Development

Hi, I am interested in writing unit tests for the SharePoint development work I am doing. Can anyone suggest practical approachs to implementing unit tests in MOSS? Note that any third party tools have to be free (but not necessarily open-source); the company I work for will not pay for additional tooling. In particular, any alternati...

Problem with getting custom errors to display on IIS7

We're running a site built in EPiServer (CMS5 R2, latest version) and ASP.NET 3.5 that's running on IIS7, we've built a custom error handler that utilizes the URLRewriter-functionality of EPiServer to handle 404 and 301 status codes, everything works locally (Windows 7 + IIS7.5) but we just can not get the 404 pages to work on the live s...

Region Agnostic Char.IsSeparator(ch)?

I have a function that parses a string containing a date(and/or time) e.g. "2009-12-10". I get the order of year-month-day from the Short Date pattern. When going through the string I use Char.IsSeparator(ch) to figure out when the numbers end. Now however in the case of Korean it seems the Char.IsSeparator(ch) returns false on separat...

Catch missing local resources in resx files.

Hi, I have many resource files, in many different languages. Lets suppose for example we are supporting 3 languages (en, de, fr), and have this file: common.resx common.de.resx common.fr.resx I would like to detect occurrences when for instance a resource is requested in de, but is missing and so reverts to the default language. Is t...