.net

Having a rich treeview

Hi all, I need to create an user interface like "liquid xml studio" the designer part in c# or something like visual studio class designer interface . I think they are using treeview control but I dont understand how it's possible to have something like expandable groupboxes with other controls inside instead of tree nodes. Thanks ...

Chess move validation library

Is there any library which can be used to validate chess moves and simulate games in .NET? It would be great if the library can understand moves in Algebraic notation and also provide simple API for making moves. For example, game.Move("E2","E4") etc. In the second case, the library should be able to generate Algebraic notation for the m...

Using Java Webservice in .NET

I am working on integrating a .NET application with a Servlet based Java application called Hermes2 (H2O). The Java application exposes several Web services, and I am trying to create Web References to these in Visual Studio 2008. However this only results in an empty proxy, commented with the error message: "CODEGEN: The operation bindi...

How to zero out memory allocated by Marshal.AllocHGlobal?

I am allocating some unmanaged memory in my application via Marshal.AllocHGlobal. I'm then copying a set of bytes to this location and converting the resulting segment of memory to a struct before freeing the memory again via Marshal.FreeHGlobal. Here's the method: public static T Deserialize<T>(byte[] messageBytes, int start, int len...

Need a lightweight web server for Windows XP Home

I need recommendations for a "light weight web server" to be ran on a Windows XP Home edition system to host a small web service (not web pages - but web service). The web service can be written in either .NET or Java. The Windows XP Home system will serve up the web service to clients consuming the service. Any suggestions? (before i...

Automatically resize TableLayoutPanel

I have a programmatically created TableLayoutPanel. It works fine but I couldn't find something: how can I make it size columns automatically when the form is resized? The panel is set to Dock.Top and when I resize the form instead of sizing every column as percents, only last column grows. What can I do for this? Here's how I add Column...

How to use the HTML Tidy .Net DLL wrapper in PowerShell?

I'm trying to use the HTML Tidy .Net wrapper in PowerShell 2.0. Here is a working example using C# (TestIt.cs included in the wrapper distribution): using Tidy; Document tdoc = new Document(); I'm doing this in PowerShell: [Reflection.Assembly]::LoadFile("C:\Users\e-t172\Desktop\Tidy.NET\Tidy.dll") New-Object Tidy.Document I get t...

WCF service unable to load referenced assemblies from the GAC

I've got a WCF service, hosted in IIS, which is built in Visual Studio. The WCF service library references a few other assemblies, which are part of the same Visual Studio solution. I deploy all the assemblies to the GAC, then start a service client, and see it fail trying to resolve one of the referenced client assemblies. I've added ...

Measuring application startup performance

I'm using C++/CLI on Windows. It's an MFC app built with /clr. I want to test how long it takes my application to start up. The first time it took 10s, but subsequently it took 4s, 4s, 5s. I'm assuming this is due to Windows caching the DLLs. Is there some tool that will allow me to remove a directory from the cache, so that my test co...

AccessViolationException when serializing a struct of arrays of structs?

I have a sequential struct that I'd like to serialize to a file, which seems trivial. However, this struct consists of, among other things, 2 arrays of other types of structs. The main struct is defined as follows... [StructLayout(LayoutKind.Sequential)] public struct ParentStruct { [MarshalAs(UnmanagedType.ByValT...

Locking .MDB record and table in .NET

I am trying to lock a record from a .mdb with OLEDB using .NET. How do I do that? How can I lock an entire table as well? ...

Visual Studio Designer: problem with custom component selection change

I have a component derived from IComponent (also tried to derive from Component) The problem: If I have 2 my custom components on the form, and one of them is selected, then I can't straightly select another my component, I have to click on something else first. Changing selection between my component and any another component (for exa...

VB6 Automation Error on Calls to .NET 3.5 Assemblies After the First Calls

Some of the sources I've checked already: http://www.experts-exchange.com/Programming/Languages/.NET/Visual%5FBasic.NET/Q%5F23359339.html http://mygreenpaste.blogspot.com/2006/03/net-framework-20-configuration-tool.html http://support.microsoft.com/kb/186063 I'm busy developing .NET modules that will hook into our existing VB6 code. I'v...

UserControl - accessing textbox within UserControl within a web form

Hello all, I am using c#.net I have different views within my webform, these all generally display different information except for three textboxes (arrival / seen / depart time). To try and cut down on code, I have created a UserControl which contains these three textboxes. I have referenced the UserControl at the top of my webform a...

ToString("0") versus ToString(CultureInfo.InvariantCulture)

I would like to make sure that certain numbers in my application are printed without any separators, groupings etc. no matter what the current environment is. It seems that the following two methods produce the same results (there are possibly more): 123456789.ToString("0"); 123456789.ToString(CultureInfo.InvariantCulture); Are you aw...

Regsvr32 and Desktop authority

I am registering a delphi assembly using regsvr32. We are currently using Desktop Authority to deploy our installation package for the .NET application. We are needing to use the delphi assembly in our .NET application so i have to register the assembly with regsvr32 with the installation. Although i have ran into problems if i regist...

Regular Expression for domain from email address

Hi, Can anyone help me with a regular expression that will return the end part of an email address, after the @ symbol? I'm new to regex, but want to learn how to use it rather than writing inefficient .Net string functions! E.g. for an input of "[email protected]" I need an output of "example.com". Cheers! Tim ...

.Net List<T> insert

Hi, I am trying to do var test = new List< int>(10); test.Insert(1, 0); or test[1] =0; I am getting exception at this. How can I insert to list? Thanks space is there to get this editor show things properly. ...

What exception type to use when a property cannot be null?

In my application I need to throw an exception if a property of a specific class is null or empty (in case it's a string). I'm not sure what is the best exception to use in this case. I would hate to create a new exception and I'm not sure if ArgumentNullException is appropriate in this case. Should I create a new exception or there's...

Alternative regular expression to do this "\.(asmx(?!/js)|aspx|htm)"

Is there a way to rewrite this regex expression such that it does not include a lookahead for "/js"? Is this even something that I should worry about in terms of performance? It is being used to filter HTTP requests. \.(asmx(?!/js)|aspx|htm) Edit: To be clear: I'd like to specifically prevent ".asmx/js" but allow all other .asmx re...