.net

How can one have a dedicated console window per AppDomain in a console .NET application?

Dear ladies and sirs. My console .NET application has several app domains. My wish is simple - console window per app domain. Motivation: The application is actually an MbUnit test assembly and the various app domains are the server hosts all packed in one process, though in different app domains to decrease execution time. Each serve...

Detect generic parameters of MethodBase

This question is continue of How to distinguish MethodBase in generics In brief: I need to distinguish in Dictionary same generic method when it is called for different generic types substitution. static Dictionary<MethodBase, string> cache = new Dictionary<MethodBase, string>(); static void Method1<T>(T g) { MethodBase m1 = Meth...

What is a satellite assembly?

What is a satellite assembly, and how can we use it? ...

Match a pattern/needle (preferrably bitmap) in a haystack bitmap?

Hi, i have two bitmaps in code (.NET). I'd like to search for the small pattern (needle) in the big image (haystack). How can this be done? ...

Reference to a TextBox inside a DataTemplate

How do I get a reference to a TextBox that's only defined inside a DataTemplate (assuming that I've just applied this DataTemplate to some cell in a grid). So far I'm using the sender in the TextBox events to retrieve this. Thanks, rui ...

Best way to store data locally in .NET (C#)

I'm writing an application that takes user data and stores it locally for use later. The application will be started and stopped fairly often, and I'd like to make it save/load the data on application start/end. It'd be fairly straightforward if I used flat files, as the data doesn't really need to be secured (it'll only be stored on th...

.NET Impersonation problem

I read a post on .NET impersonation at http://www.dotnet247.com/247reference/msgs/28/144136.aspx, and that is the base code I am working from. I'm having a problem copying a file to a network share. When finished, this console application will run on a remote server and copy files to a share on a different system. The two systems can se...

what's an easy way to use hyphen named inputs in a console app (i.e. -S "myServerName")?

I'd like my console app to use hyphen-named inputs, like so: myApp -S "myServerName" -D "myDatabaseName" instead of the usual: myApp "myServerName" "myDatabaseName" I think the first is more friendly to developers that want to use my console app down the road. I think that I don't know what this type of input is called, else I wo...

Best resources & books for ASP.NET MVC Framework

Possible Duplicates: Good asp.net mvc (VB) books Best ASP.NET MVC book? Best resources & books for ASP.NET MVC Framework ...

ASP.net Webforms, Methods for controlling the ClientID

I'm having a WebForms application which used to mostly run on Postbacks. But now, I'd like to use jQuery more and more, and I would prefer to control the ClientID so that I have a true "#id" selector instead of using "input[id$=myID]". Now, as I still like to use ASP.net Controls (I need to work with them through CodeBehind), I wonder i...

How to play a audio sound in a web page as a background music

I want to play an audio file whenever my page gets loaded onto the client browser. And if a user presses a pause button on the web page then the sound gets paused until he leaves the sound and can resume as well. ? ...

Encrypt a filename in C# without including unusable chars in the resulting string

I want to encrypt a filename but ensure that the encrypted filename doesn't contain any of the characters that are not allowed (on a windows system) in filenames. The string also needs to be able to be decrypted back to the original filename (so you can't just filter out the invalid characters after the encryption). To my knowledge the...

DateTime to UnixTime Stamp in .net

Is there any function in vb dot net to convert datetime to unix time stamp If I google I get only the vice versa but not vb.net to unix time stamp Any help is appreciated ...

How to block until an asynchronous call is complete?

I have a method which calls an asynchronous method, and a callback which is fired when the asynchronous method finishes. I want my method to appear syncrhonous, so I've created an AutoResetEvent, called the asyncrhonous method, the call WaitOne() on the AutoResetEvent instance, and I call Set() in the callback method. Something like th...

DataGridView -- Simultaneous input and output -- Is this a bug in DataGridView

I have created a C# Windows Forms application which I've attempted to make as simple as possible to demonstrate a problem I am running into. I'm trying to use a DataGridView to allow user input in one column while simultaneously getting updates in another column from a background thread. The problem is that the Input column is effectiv...

Package tsql with application

How can I release a winform application to a user that takes advantage of a local sql database. I would assume that I need to install the database during some kind of setup phase, but is this kind of thing possible? Is there a free version of tsql that can be used in this way? Mysql? ...

How to access controls located in the listview from codebehind ?

I have a ListView called CouncilListView and a TextBox called EmailTextBox which is in the ListView. How can I access this TextBox from the CodeBehind? I tried some forms of FindControl like : this.Page.FindControl("EmailTextBox"); this.Page.FindControl("CouncilListView").FindControl("EmailTextBox"); this.CouncilListView.Findcontrol("...

ReportViewer doesn't print Color on other machines

I have a very simple C# WinForms project with a ReportViewer control docked in the center. I've created a local report (rdlc) file that contains an embedded color picture. If I compile and run this on my local machine, I can view the color image and print to my color printer and everything works fine. If I move the application to a di...

"Errors During Preprocessing" is non-zero in ASP.NET perfmon counters

While testing an ASP.NET application with perfmon, we find that the following field is non-zero: ASP.NET Apps v2.0.50727 > Errors During Preprocessing Documentation says that this field is "The number of errors that occurred during parsing, excluding compilation and run-time errors." However, I have not been able to track down why...

How do I add a list object to class using lambda?

Say I have a class with 2 properties class TestClass { public int propertyOne {get;set;} public List<int> propertyTwo {get; private set;} public TestClass() { propertyTwo = new List<int>(); } } Using linq, I am trying to create a list of TestClass as follows: var results = from x in MyOtherClass ...