all groups > c# > october 2007 > threads for sunday october 21
Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
2.0+ Events Handled by 1.x Subscribers
Posted by Robert Cramer at 10/21/2007 11:12:45 PM
Given that Generics are available only in .NET 2.0+ and not in 1.x....
If a .NET 2.0+ event publisher were to make use of System.EventHandler<T>,
or otherwise make use of Generics, in its event implementation, would that
preclude a .NET 1.x app from subscribing to and handling that event?
... more >>
Fire event in the same thread as the UI like BackgroundWorker
Posted by Sin Jeong-hun at 10/21/2007 5:26:27 PM
This is what I've always been wondered.
Suppose I've created a class named Agent, and the Agent does some
lengthy job. Of course I don't want to block the main window, so the
Agent does the job in a separate thread. If the job is progressed it
fires an event, and the main window handled the even... more >>
Redirect lengthy application's output?
Posted by Sin Jeong-hun at 10/21/2007 4:35:27 PM
Process p = new Process();
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.UseShellExecute = false;
p.Start();
p.StandardOutput.ReadToEnd();
This works if the application outputs very little amount of string and
exits quickly. But what if the application does a lengthy job and
output... more >>
Regex OnKeyDown question
Posted by el_squid_2000 NO[at]SPAM yahoo.com at 10/21/2007 11:00:38 AM
Hi - I have a regex defined as [^A-Z0-9] and I am trying to allow only
uppercase alphanumeric input in a textbox. So I have Uppercasing set
to true elsewhere in the program and I have an OnKeyDown event handler
with
e.SuppressKeyPress = false;
if (myRegex.IsMatch(e.KeyData.ToString()))
... more >>
How to continue using a Socket after a timeout?
Posted by carl.rosenberger NO[at]SPAM gmail.com at 10/21/2007 8:16:24 AM
Hi,
I am trying to get the following behaviour for my Socket connection:
(1) Attempt a blocked read for a defined amount of time.
(2) If a timeout occurs, because no data has been sent to the socket,
throw an exception.
(3) Catch the exception and either go back to (1) or quit reading,
dep... more >>
How to get expand the height of ListView control so that no scrollbars will show?
Posted by deerchao at 10/21/2007 5:12:14 AM
I set ListView.Dock to Top, but how can I get the desired height to
avoid it to show vertical scrollbar?
I mean is there something like ListView.ClientSize or
ListView.VirtualHeight?
Thanks!
... more >>
Scanning hard drive
Posted by Rotsey at 10/21/2007 12:00:00 AM
Hi,
I am writing an app that scans hard drives and logs info
about every fine on the drive.
The first iteration of my code used a class and a generic list
to store the data and rhis took 13min on my 60 GB drive.
I wanted it to be quicker.
So the second time I changed the class to a str... more >>
Random Number Generation
Posted by Anil Gupte at 10/21/2007 12:00:00 AM
I had someone write a random number generator in C# (I am more of a VB
programmer) and they came up with the following:
public string GetRand(int count)
{
string number = "";
for (int i=0; i<count; i++)
{
Random Rnd = new Random();
number = number+Convert.ToString(Rnd.Next(0,9));
}
retu... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
LoadLibrary not working on Vista64?
Posted by Peter Morris at 10/21/2007 12:00:00 AM
I have a class named DynamicLinkLibrary which does this:
[DllImport("kernel32.dll")]
private static extern IntPtr LoadLibrary(string fileName);
protected virtual void Load(string fileName)
{
EnsureNotDisposed();
if (LibraryHandle != IntPtr.Zero)
throw new InvalidOperatio... more >>
Nunit: Where does the .config file go?
Posted by chris at 10/21/2007 12:00:00 AM
I have created a file, called nunit_project_name.dll.config, within
the bin folder of my Nunit project, but Nunit is not able to find the
file. Is this is the right location?
I can access the proper connection string if I put in in the
machine.config file, but obviously this is not the best c... more >>
|