Here is my code:
ThreadStart threadStart = controller.OpenFile;
Thread thread = new Thread(threadStart);
thread.Start();
In the OpenFile function my code looks like:
System.Console.Error.WriteLine("Launching");
The code in OpenFile doesn't get executed for 30 seconds exactly. It starts immediately on my machine but in our producti...
I've got a bunch of properties which I am going to use read/write locks on. I can implement them either with a try finally or a using clause. In the try finally I would acquire the lock before the try, and ralease in the finally. In the using clause, I would create a class which acquires the lock in its constructor, and releases in its...
I'm trying to work through the problems on projecteuler.net but I keep running into a couple of problems.
The first is a question of storing large quanities of elements in a List<t>. I keep getting OutOfMemoryException's when storing large quantities in the list.
Now I admit I might not be doing these things in the best way but, is the...
What is the troubleshooting process for the "Retrieving the COM class factory for component with CLSID {XXXX} failed due to the following error: 80080005" errors in .Net? To clarify: I am getting this at runtime, on my XP machine, with client being .net code running under admin account. {XXXX} refers to one of our in-house COM components...
I'm trying to read the contents of a text file, in this case a list of computer names (Computer1, computer2 etc,) and I thought that StreamReader would be what you would use but when I do the following:
StreamReader arrComputer = new StreamReader(FileDialog.filename)();
I get this error:
The type or namespace name 'StreamReader' coul...
I am stuck building reports that will be generated by a custom application using the Crystal Reports 9.1.5 that comes with Visual Studio 2003. In addition to the editor being one of the most infuriating things I've ever had to work with I am also constantly hounded by the various gotchas having to do with their code generation engine.
...
Hi,
I've been using the Java Pet Store and .Net Pet Store examples for years when comparing JEE and .Net performance in an eBusiness type setting.
Is there a better way to compare the performance of JEE and .Net for this type of application?
Update:
As some have pointed out below, the implementation, framework versions, architecture...
How can I extract the list of colors in the System.Drawing.Color struct into a collection or array?
Is there a more efficient way of getting a collection of colors than using this struct as a base?
...
What's the best/most efficient way whether the user of my .NET web application is currently logged in.
I'm currently using Membership.GetUser() != null, but now that I realize that this involves a DB-roundtrip, I wonder if there's a better way. Maybe HttpContext.Current.User.Identity.IsAuthenticated?
...
Ok. I'm having an issue with the following bit of code:
StreamReader arrComputer = new StreamReader(FileDialog.FileName);
My first question had been answered already now my second question focuses on the tail end of this code.
I'm reading a text file StreamReader that the user selects with a button event using OpenFileDialog
priva...
I'm trying to put a Message back into an MSMQ when an exception is thrown. The following code appears to work but the Message is not put back in the queue?
Message msg = null;
try
{
MessageQueue MQueue = new MessageQueue(txtMsgQPath.Text);
msg = MQueue.ReceiveById(txtQItemToRead.Text);
lblMsgRead.Text = msg.Body.ToString(); ...
I had the following line snippet of code that searches for a propery of an instance by name:
var prop = Backend.GetType().GetProperty(fieldName);
Now I want to ignore the case of fieldName, so I tried the following:
var prop = Backend.GetType().GetProperty(fieldName, BindingFlags.IgnoreCase);
... No dice. Now prop won't find field...
I have a web page that is being displaying in a winform app using the WebBrowser Control. I need to perform an event when the HTML in the web page changes; however, I cannot find an event that is triggered for situations when the pages is updated through Ajax. The DocumentComplete, FileDownloaded, and ProgressChanged events are not alway...
This is a C# console application. I have a function that does something like this:
static void foo()
{
Application powerpointApp;
Presentation presentation = null;
powerpointApp = new Microsoft.Office.Interop.PowerPoint.ApplicationClass();
}
That's all it does. When it is called there is a fifteen second delay be...
I have written an installation class that extends Installer and overrides afterInstall, but I'm getting a null pointer exception. How can I got about debugging my class?
...
What are some ideas (using .NET and SQL 2005) for implementing a service that sends emails? The emails are to be data-driven. The date and time an email is to be sent is a field in a table.
...
How could you calculate the minimum width needed to display a string in X lines, given that text should break on whitespace?
...
WPF GridSplitter makes my Grid wider than my Window!
I've got a WPF Grid with a GridSplitter. If I resize my columns, then I can make my grid wider than my window and non-viewable.
It starts like this:
But after widening the left column, I can no longer see the right column (green):
What am I doing wrong? How do I keep the ...
Hi there.
I have a curly one here. When we remote a method (that is using generics) the remoting sink cannot seem to discover our method from the other identical named ones. Debugging with .net source code attached I've got it to where there is a MethodInfo. MakeGenericMethod call. However I cannot look at any of the surrounding data as...
I don't expect to get a great response from this, so if you have had experience in this any contribution would be appreciated.
I am trying to use the Visual Studio Report Designer with a Linq to SQL datasource, I have no experience of using the Visual Studio Report Designer.
If I go through the wizard and use an object datasource I can...