.net

.NET or Windows Synchronization Primitives Performance Specifications

Hello *, I am currently writing a scientific article, where I need to be very exact with citation. Can someone point me to either MSDN, MSDN article, some published article source or a book, where I can find performance comparison of Windows or .NET Synchronization primitives. I know that these are in the descending performance order: ...

Reporting Tool or Software for Printed Forms?

We are creating a new HR application (.NET) that requires printing of complex forms (IRS documents, employment forms, pay checks, etc). Some of these would be printed on preprinted stock (i.e. W-2s) while others would need to save the formatting within the report/form design. In our OLD legacy applications, we have used C programs to...

attached process error VS C++ .NET

When I go to Debug -> Start I get the error: "Unable to attach to machine 'mypc' Do you want to continue anyway? YES/NO I did not attach a proces and am not sure why it is coming up. (Also, when I hit YES to the error, it does not run.) How do I remove all attachments on the debugger? ...

How and when does .NET actually compile code?

Let's say you write an app in C#, VB, anything with .NET When you hit build, does it really compile your code? I thought so until I started using redgates reflector on some of my assemblies and saw my code verbatim. I would have expected loops to be unrolled and another plethora of optimizations, instead nothing. So when does the compil...

Save Webpage as Word Document? (VB.NET)

I'm trying to create a Word document in vb.net. I can't use the COM Word.Application method due to permission issues on the server. So i've recreated the WORD document in HTML and tried to change the content-type and just output the HTML It works 'ok'. It outputs the HTML and opens up word with a read-only file with the content in there...

What is the most appropriate way to use .Net 4.0's MemoryMappedViewAccessors?

When displaying a large, memory mapped file in a scrollable box, is it more appropriate to have the view represent the whole file, or only the region of the file currently being displayed? More broadly, at what level of the abstraction is paging done with .Net's memory mapped files? Is the page size/amount of the file held in memory rel...

Run a DOS command in .NET

I have a set of commands like: C: cd Project testproj.exe My system gets these commands one by one from a remote system. I need to execute each command in cmd.exe on receiving the command from the remote system. How to execute these using .NET? I also need to return the result of testproj.exe to the remote machine. How to take the ...

Regex help for MediaWiki template markup

My regex skills are pretty poor, and most of the time they make me feel stupid. Can anyone help? This question is more concerned with better mastery of regex than the job of extracting information from mud soup, so if my understanding of the mediawiki template system is flawed, I don't really mind that much. I'll spot it soon enough. I...

C#: How do you invoke a function that returns a type in an if statement inside another thread?

I have on form (ui thread) and a backgroundworker thread. I am trying to check whether a radio button in the main ui thread is checked or not inside the backgroundworker thread. How would I go upon comparing the bool type inside an if statement that is inside my backgroundworker's dowork event? Note: I am using WPF. private void ba...

How do I reduce interface lag in C#?

I have a problem with interface lag in C#. Since I'm still learning please be patient whilst I explain. I have narrowed the problem to my timer object. Basically my program queries a device through TCP/IP socket and outputs it to a textbox on screen. Now I'm polling the device for data every second which requires some logic to be bur...

centralize report in winform application

I working on a winform app and would like the same reports available to others when the reports are edited or modified. Currently when a report is modified I have to re-deploy the app or copy the report file to a folder. I am looking for an alternative. Super users of the app have the option to go to design mode and edit the report. Is...

Is there a built in name/value pair attribute?

Hi all Is there a built in attribute in the .net framework to mark up code with an arbitrary key and value? I've had a look through the list, but can't see anything useful there. What we ideally want is to be able to say [NameValuePair("MyKey", "My long bit of text")] ...and then pull it out later on Actually, what we really want to...

Color Interpolation Between 3 Colors in .NET

I would like to smoothly interpolate color from Color A (let's call it red) to Color C (let's call it green) going through color B (let's call it yellow), based on the value of a certain variable. If the variable = 100, I want pure green. If the variable = 50, I want pure yellow. If the variable = 0, I want pure red. I understand you c...

Algorithm to find word on boggle board vb .net

Hello, I'm building a boggle game in vb .net. Right now, my dices are as a 2d array (0,0 0,1 ) etc... What I want it to do is, as I'm typing the word, that it hilights it on the board using the button(x,y).doclick sub which highlights it. Right now my implementation finds the first letter, then keeps trying each letter until it meets t...

Decode CDATA section in C#

I have a bit of XML as follows: <section> <description> <![CDATA[ This is a "description" that I have formatted ]]> </description> </section> I'm accessing it using curXmlNode.SelectSingleNode("description").InnerText but the value returns \r\n This is a "description"\r\n that I have formatted instead...

Upgraded .net webapp can't open connection to database

I have an old .net 1.0 webapp that needs a bit of maintenance done on it. I've used the auto-upgrader to upgrade it to .net 3.5 (and also later tried 2.0) but now it can't connect to the database. On the surface this looks like a noob connection-string problem, but I'm thinking it's more likely to be related to some subtle problem from ...

Get running threads information in an Application

I'm developing desktop application, where I upload series of FPGA files on scanning device, to do this job I have COM DLL provided by driver. For uploading files I call method named "StartWrite", which start worker thread to write FPGA to device. And now in C# how do I get list/information (expected execution time etc.) of worker thre...

Good Tutorial for Resharper Templates

I'm looking to get into some of the more advanced features of resharper tamplates. I know just enough to be dangerous by looking at some of the existing templates. What are some of the more advanced features beyond using a variable name in between dollar signs and using $END$ to show where your cursor goes? What are some good sources ...

IM Proxy settings in app.config

I'm writing a chat application for google talk using XMPP in .NET (with agsXMPP.dll library). The chat application's login fails in my office because there is a specific proxy for IM. How to explicitly specify the proxy details. Can it be done in app.config? My gtalk settings which works fine for gtalk: Host:improxy Port:8085 Proxy requ...

Psuedocode of this algorithm

Hello, Im making a game that involves a 4*4 grid the user enters letters and the game has to highlight the letters and they have to be next to one another. I have a sub that checks if the current letter is next to (or neighbouring) the last letter. Basically what needs to happen is : for each letter iterate through the grid and try ev...