.net

add a vanity url to subtext article

So I'm running subtext 1.95 on IIS6 and .net 2.0 framework. What I'd like to do is create a nice vanity URL to a particular article that is published inside the subtext system. The vanity url should look like this: mydomain.com/blog/toc/, but the subtext article that it is pointing to actually has a path like this: mydomain.com/blog/arch...

Localization of a WinForms app and later UI changes

I am using VS2008 to develop a WinForms 2.0 application. I have read about how to localize my app in the Visual Studio by setting the Localizable property to true in the designer etc. I would like to ask about your experience, how does it work when I translate the app into several languages and then make changes to the user interface. ...

Is there any way to call the parent version of an overridden method? (C# .NET)

In the code below I tried in two ways to access the parent version of methodTwo, but the result was always 2. Is there any way to get the 1 result from a ChildClass instance without modifying these two classes? class ParentClass { public int methodOne() { return methodTwo(); } virtual public int methodTwo() ...

Extracting Path from OpenFileDialog path/filename

I'm writing a little utility that starts with selecting a file, and then I need to select a folder. I'd like to default the folder to where the selected file was. OpenFileDialog.FileName returns the full path & filename - what I want is to obtain just the path portion (sans filename), so I can use that as the initial selected folder ...

nHibernate update does nothing

I have a very weird problem: sometimes when I call nHibernate update to an entity and it works, and some times it does nothing, in the same call. When it doesn't do the update, nHibernate does not return an exception or anything like that. It simply does nothing. Have you ever had this kind of trouble? ...

UserControls Classname-Namespaces issue

I want to change Control(@Control) directive in a way to make it redistributable and want to use ClassName attribute so I changed this From : <%@ Control Language="C#" AutoEventWireup="true" CodeFile="ProductShower.ascx.cs" Inherits="MyCompany.Web.Controls.ProductShower" %> To : <%@ Control Language="C#" ClassName="MyCompany.Web.C...

What is the best way to document data reader method calls?

When working with namespaces such as System.Data.Odbc or System.Data.OracleClient the various data reader methods generally require an integer corresponding to a column be provided to the functions (e.g. OracleDataReader.GetInt32). My question is this, what is the best way to work with these functions so that the code is fairly self-do...

C++ .NET equivalent to java public static void main()?

In java I can simply test classes directly with public static void main() I then just add quick code and under Eclipse "Run" the class. Is there anything similar in C++ .NET ? Right now I have to create an empty project, reference the correct headers then set that project as start up project. ...

.NET How to check if path is a file and not a directory?

I have a path and I need to determine if it is a directory or file. Is this the best way to determine if the path is a file? string file = @"C:\Test\foo.txt"; bool isFile = !System.IO.Directory.Exists(file) && System.IO.File.Exists(file); For a directory I would reverse the logic. string directory = @"C:...

Changing the .NET application configuration file name.

I have a VB6 app which calls a .NET assembly, which references settings from the app.config file. By default, .NET looks for a config file named after the VB6 app. How can I redirect it to use a different config file name? This needs to become the default config file so that e.g. WCF settings are read from it. ...

.NET Printing multiple pages of diferent data

In my app I have serveral forms that print specific data. For accomplish that I use the PrintDocument PrintPage Event. If one report has more than 1 page... I set the hasMorePages flag to true... and the event is fired again and it is my responsability to continue printing from where I was at the end of the last page. That is correct. ...

Getting process information in .NET

Duplicate of this question. update - This is not an exact duplicate. See my solution. I see a java.exe process in process explorer, and double clicking it gives me its working directory & starting command line arguments. From .NET, I run the following code and get a process with the same PID but the above fields are empty. Apparently,...

How to implement shared memory in .NET ?

I have a C++.NET app and a C#.NET app. I would like them to communicate via shared memory. How is it possible in .NET version 2.0 ? Mainly want to share a queue object. ...

How do you (Unit) Test the database schema?

When there are a number of people working on a project, all of who could alter the database schema, what's the simplest way to unit test / test / verify it? The main suggestion we've had so far is to write tests for each table to verify column names, constraints, etc. Has anyone else done anything similar / simpler? We're using C# with ...

Guidelines for using IDictionary (.NET)

I believe that IDictionary classes works better with sortable objects. I believe also that the IComparer interface is necessary to sort objects from a class. I also read at MSDN that when you implement IComparable you'll need to override the Equals method (and GetHashCode by extension I presume). I have three doubts: 1) Any of the assu...

.NET Options Stream Video Files as WebCam Image

I am interested in developing an application that will allow me to build a list of videos from xml (containing video title, duration, etc) and play that list as my webcam stream. Meaning, if I were to visit ustream.tv, or activate my webcam on live messenger my video playlist would register as my active webcam. Does anybody have experie...

Is it possible to reuse a .NET WinForms Form object?

Once a window has been closed, it is possible, and it is recommended, to reuse that window's Form instance to show the same window again? Or is it required or recommended to always create a brand new instance of the class when you will be showing a window. What this really boils down to is whether it is a good idea to ever call Show() ...

locale-independent way of getting standard windows registry security object

Is there a way to get the built-in "Everyone" registry security object in a locale-independent manner? I want to make a RegistryAccessRule without needing to translate "Everyone" to each language. ...

To PerformanceCounter or To Write Custom Monitoring?

I have a Windows service that runs implementations of a framework across multiple threads. Each running instance has several things in common that I need to keep track of, for example, number of items processed, last time an item was processed, etc. On top of this base monitoring data, I'd like to offer functionality in the framework t...

How to Asynchronously fetch AutoComplete data for a TextBox?

Our WinForms application does lazy loading of the data for auto complete of a textbox. The pseudocode for this is as follows; User types in TextBox On typing pause, determine if we need to fetch the auto complete data In worker thread, contact the server and fetch data Invoke back to the UI thread Set textBox.AutoCompleteCustomSource ...