.net

Open-source Mavis Beacon alternatives?

Does anyone here know of any good open-source Mavis Beacon typing software alternatives? I would like to adapt one for a behavioural experiment I'm writing. Preferably .NET (but any language will do). I am aware of TuxType - are there others? Thanks a lot! ...

Validating file types by regular expression

I have a .NET webform that has a file upload control that is tied to a regular expression validator. This validator needs to validate that only certain filetypes should be allowed for upload (jpg,gif,doc,pdf) The current regular expression that does this is: ^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))(.jpg|.JPG|.gif|.GIF|.doc|.DOC|.pd...

.net open source and running platform choices

Hi Guys, We have been asked to look into a fully open source solution for a big project, they want the project be as near to 100% Open Source as possible, mainly because as its a community project there may be very little money available in the future except for the running of a host. Using OS software saves on licence costs as the serv...

Follow up: How do get some of the object from a list without Linq?

I have a question about this question. I posted a reply there but since it's been marked as answered, I don't think I'll get a response to my post there. I am running C# framework 2.0 and I would like to get some of the data from a list? The list is a List<>. How can I do that without looping and doing comparaison manually o...

How do you measure code block (thread) execution time with multiple concurrent threads in .NET

Right now we just use something like this stopWatch.Start(); try { method(); } finally { stopWatch.Stop(); } Which works fine for synchronous methods, but some are executing asynchronously, so the time is skewed when multiple threads are execut...

Screen-scraping a windows application in c#

I need to scrape data from a windows application to run a query in another program. Does anyone know of a good starting point for me to do this in .NET? ...

Convert style-laden HTML tables to PDF, in .NET 1.1

I have colleagues working on a .NET 1.1 project, where they obtain XML files from an external party and programmatically instruct iTextSharp to generate PDF content based on the XML data. The tricky part is, within this XML are segments of arbitrary HTML content. These are HTML code users copied and pasted from their Office applications...

How to get control index in WinForms?

I have a Panel with a collection of controls in it. How can I get the index of a specific control when iterating through them? I'm using foreach to iterate, but there's no Index property. Should I use for x = 0... and return x when my match is made, or what? ...

A clean way of generating QueryString parameters for web requests

I came across a problem in my current application that required fiddling with the query string in a base Page class (which all my pages inherit from) to solve the problem. Since some of my pages use the query string I was wondering if there is any class that provides clean and simple query string manipulation. Example of code: // What ...

CLR stored procedure calling .NET class instance

Hi, I codded a CLR stored procedure (listed below) The line of code where the exception is thrown was added just for the purpose of having the exception logged in EventLog I deployed the assembly and created the stored proc in database However when I execute the stored procedure no entry is logged in Windows' EventLog If the code wh...

XNA - Keyboard text input

Okay, so basically I want to be able to retrieve keyboard text. Like entering text into a text field or something. I'm only writing my game for windows. I've disregarded using Guide.BeginShowKeyboardInput because it breaks the feel of a self contained game, and the fact that the Guide always shows XBOX buttons doesn't seem right to me ei...

How to restrict client control area in a custom WinForms control

Hello, I have a custom control that uses a designer I've inherited from ParentControlDesigner to allow child controls to be dropped. I'm not using any internal designers, just straightforward single-parent stuff. This control draws a "header", so I'm trying to do three things: Have child controls dock to the bottom of the header ins...

Can't instantiate a COM object written in C# from VBA (VB6 ok)

Using VS 2008, here is my COM object using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; using System.Windows.Forms; namespace TestCom { [Guid("9E5E5FB2-219D-4ee7-AB27-E4DBED8E123E")] [ClassInterface(ClassInterfaceType.AutoDual)] [ProgId("Test9.COMINT")] public cl...

Calling SSIS from a .aspx page, what permissions to give to NT AUTH\Network Service account?

When I call a SSIS package using LoadPackage() from a .aspx page (or windows service), how do I setup permissions for it to work? Event viewer is reporting a Sql server error: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'. Reason: Failed to open the explicitly specified database. [CLIENT: 192.168.73.118] How do I give that acco...

What the best/correct way to setup a load balanced environment for a web application?

I develop a web application that needs to be load balanced across 4 webservers. My company is purchasing the load balancer hardware (Cisco). There is confusion on how to tell the load balancer that a webserver should be in the rotation. The IT Hardware support team wants me to create a one page web application that will sit next to the...

WPF GridSplitter Doesn't Work With WebBrowser Control?

I've been struggling with the GridSplitter. It seems to be incompatible with the WPF WebBrowser control. If I resize my window and move the GridSplitter, then I can make my grid wider than my window and non-viewable. Before: After: (note scrollbars) My XAML... <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presenta...

Getting the .NET Framework directory path

How can I obtain the .NET Framework directory path inside my C# application? The folder that I refer is "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727" ...

Call to a method never returns

I am working with a COM component. There is a method that does this call to the component, and this method is used many times in my application, for each document to be processed, this method is called. One weird thing happens sometimes suddenly, doesn't matter the amount of documents processed, it can happen after processing 60, 100 or...

Does ServiceBase.OnStop get called when a .Net 2.0 service crashes?

When a .Net service crashes, does the ServiceBase.OnStop method get called? Will the service be marked as stopped regardless of whether or not the OnStop method is called? ...

Does a dotnet crashing service terminate its own threads?

I have a windows service written in dotNet. There is a worker service that spawns worker threads using various Delegate.BeginInvokes. When the service crashes are those threads going to be cleaned up automatically? And if so, when? ...