|
I am running a dual core 2.3g pentium 2 with 2 gb of ram. See below for a list for the output of the program - note the elapsed time; It is strange because when I go to contorl panel - add/remove programs it is allot faster - even for the first time after boot. Perhaps windows in caching the entries where as this method probably reads through the registry in a manual fashion....See the output of the program below.
<<<
Querying registry for installed components. Please wait...
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
...............................................................
.............................................
Elapsed Time: 00:04:22.0502292
Date and Time: 9/11/2008 11:14:55 AM
Machine Name : 4GBD01914
Environment : Microsoft Windows NT 5.1.2600 Service Pack 2
Nokia Flashing Cable Driver Version: 8.23.0.0
Nokia Connectivity Cable Driver Version: 7.1.1.0
TSS Communication API int Version: 2008.26.000.34173
Nokia Service Tool Drivers Internal Version: 5.00.0000
Nokia Service Tool Drivers Internal Version: 6.04.0000
Microsoft Software Update for Web Folders (English) 12 Version: 12.0.4518.1014
Microsoft Office Visual Web Developer 2007 Version: 12.0.4518.1066
Microsoft Office Visual Web Developer MUI (English) 2007 Version: 12.0.4518.1066
Microsoft Office Visio MUI (English) 2007 Version: 12.0.4518.1014
Microsoft Office Shared Setup Metadata MUI (English) 2007 Version: 12.0.4518.1014
Microsoft Office Proofing (English) 2007 Version: 12.0.4518.1014
Microsoft Office Shared MUI (English) 2007 Version: 12.0.4518.1014
Microsoft Office Proof (English) 2007 Version: 12.0.4518.1014
Microsoft Office Proof (Spanish) 2007 Version: 12.0.4518.1014
Microsoft Office Proof (French) 2007 Version: 12.0.4518.1014
Microsoft Office Visio Professional 2007 Version: 12.0.4518.1014
Time Zone Data Update Tool for Microsoft Office Outlook Version: 12.0.4518.1029
Visual Studio Tools for the Office system 3.0 Runtime Version: 9.0.21022
WebFldrs XP Version: 9.50.7523
Microsoft .NET Framework 3.0 Service Pack 2 Version: 3.2.30729
Microsoft Windows SDK for Visual Studio 2008 Win32 Tools Version: 6.1.5288.17011
Microsoft SQL Server Native Client Version: 9.00.3042.00
Microsoft Device Emulator version 3.0 - ENU Version: 9.0.21022
MSXML 4.0 SP2 (KB925672) Version: 4.20.9839.0
Microsoft .NET Framework 3.5 SP1 Version: 3.5.30729
Windows Mobile 5.0 SDK R2 for Pocket PC Version: 5.00.1700.5.14343.06
Microsoft SQL Server Compact 3.5 SP1 Design Tools English Version: 3.5.5692.0
QuickTime Version: 7.3.1.70
Microsoft Visual Studio 2008 Professional Edition - ENU Version: 9.0.21022
MSXML 6.0 Parser Version: 6.10.1129.0
Microsoft Windows SDK for Visual Studio 2008 SDK Reference Assemblies and Intell
iSense Version: 6.1.5288.17011
SQL Server System CLR Types Version: 10.0.1600.22
Microsoft SQL Server 2005 Express Edition (SQLEXPRESS) Version: 9.2.3042.00
Microsoft SQL Server Compact 3.5 for Devices ENU Version: 3.5.5386.0
Microsoft SQL Server VSS Writer Version: 9.00.3042.00
Microsoft Windows SDK for Visual Studio 2008 .NET Framework Tools Version: 3.5.2
1022
Microsoft Office Professional Edition 2003 Version: 11.0.8173.0
Microsoft Organization Chart 2.0 Version: 11.0.5614.0
Microsoft Office 2003 Proofing Tools Version: 11.0.8173.0
Microsoft Visual Studio 2005 Tools for Office Runtime Version: 8.0.60940.0
Crystal Reports Basic for Visual Studio 2008 Version: 10.5.0.0
Microsoft SQL Server 2005 Tools Express Edition Version: 9.2.3042.00
Microsoft .NET Compact Framework 2.0 SP2 Version: 2.0.7045
Security Update for CAPICOM (KB931906) Version: 2.1.0.2
FastTrace Plugin Wizard Version: 1.0.0
Microsoft .NET Compact Framework 3.5 Version: 3.5.7283
Symantec Client Security Version: 10.1.5010.5
Microsoft SQL Server Compact 3.5 SP1 English Version: 3.5.5692.0
Microsoft Document Explorer 2008 Version: 9.0.21022
Microsoft Windows SDK for Visual Studio 2008 Headers and Libraries Version: 6.1.
5288.17011
Windows Mobile 5.0 SDK R2 for Smartphone Version: 5.00.1700.5.14343.06
Microsoft SQL Server Database Publishing Wizard 1.2 Version: 1.2.0.0
Microsoft Silverlight Version: 1.0.30716.0
Microsoft .NET Framework 2.0 Service Pack 2 Version: 2.2.30729
Microsoft SQL Server Setup Support Files (English) Version: 9.00.3042.00
ActivePerl 5.6.1 Build 635 Version: 5.6.635
Microsoft Windows SDK for Visual Studio 2008 Tools Version: 6.1.5288.17011
<<<
|
|
|
|
|
Also, I need to get the version of an installation, not the individual assemblies within it.
For example, If I have a driver installer version 1.0. I may contain the following sets;
driverX.sys version 1.1
driverY.sys version 1.11
driverZ.sys version 1.12
Where is the Add/Remove feature in the control panel looking to obtain the 1.0?
Regards,
Matt
|
|
|
|
|
Hi,
I need to parse a solution file and determin all the csproj locations that belong to the solution.
Could you give me a regex that would return that?
For example I have this in a solutionfile
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PersonList", "PersonList.csproj", "{2B009498-47EB-4A26-B5F4-8A855348065E}"
EndProject
I need to obtain "PersonList.csproj", showing that the project is in the same place with the solution
Could you please help me?
Thank you
|
|
|
|
|
Sounds to me a little bit too complex for what a regex can achieve. I think you would need to write a custom parser using string functions, or a compiler generation tool.
Hope this helps,
Chris
|
|
|
|
|
I used
Regex r = new Regex("\"\\w*.csproj\"");
and checked for duplicates.
Thanks for your answer
|
|
|
|
|
That's what I used a while ago:
Regex projects = new Regex(@"Project.*""(.+\.csproj)""");
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I have a program that will grab caller ID data from a rosewill USB modem. The main form is used to convey information from a database that I compiled from areacodedownload.com such as latitude and longitude data and will pass those values to the weekly weather for the calling party as well as an area map. I added a check box for each of the websites as a form of error checking. Red means the site is unavailable and Green means available. When the checkbox is checked it will reevaluation if the site is still reachable. However when I click on these four checkboxes in a row a couple times the program hangs and the form is not redrawn forever. The code for one of the checkboxes is below
private void checkBox4_Checked(object sender, EventArgs e)
{
try
{
WebRequest test = WebRequest.Create("http://dev.virtualearth.net");
WebResponse tested = test.GetResponse();
checkBox4.BackColor = Color.Green;
}
catch (WebException)
{
checkBox4.BackColor = Color.Red;
}
}
I can't seem to find if there is a Busy property in the WebRequest class. These checkboxes are just inside a group container and it doesn't matter what the value of them is. I'm just using them as a toggle. The values are checked on Form_Load() and then whenever the checkbox is clicked. I'm using the same object name "test" for each of the checkboxes, but the scope should be within each method and shouldn't matter if I use it for all four checkboxes.
|
|
|
|
|
Is there a way to internationalize the strings in the AssemblyInfo for a C# DLL? I am used to doing this with the VersionInfo in C++ where you could have a separate instance for each language and each VersionInfo instance could be placed in a separate resource DLL. If not, is there another approach I should look into?
|
|
|
|
|
Short version of problem:
When the user clicks a button, a blocking method is called. Inside this blocking method, the calling thread will be put to sleep. When the thread is sleeping, I receive events and I want those events to update the text on a TextBox immediately. However, since the thread is sleeping, the GUI won't be updated until the thread is woken up from sleeping, even if I use this.Invoke() to update the GUI. Is there a solution to my problem?
Long version of problem:
When the user clicks a button, I want a method called comPortSendAndReceive to be called. Inside comPortSendAndReceive the calling thread is put into sleep and when the com port receives a certain combination of bytes it will wake the thread up by calling Interrupt() on the thread that called comPortSendAndReceive. However, at the same time I want a TextBox to immediately display all characters that are received over the com port. How can I accomplish this? Below are some snippets of code to further explain what I'm trying to do:
public delegate void SetStringDelegate(string stringToSet);
public class Form1
{
private void appendStringInTextBoxDelegate(string stringToAppend)
{
if (textBox.InvokeRequired)
{
this.Invoke(new SetStringDelegate(textBox1.AppendText), new object[] { stringToAppend });
}
else
{
textBox.AppendText(stringToAppend);
}
}
private void sendAndReceiveButton_Click(object sender, EventArgs e)
{
comPort.connect("COM1", appendStringInTextBoxDelegate);
string myReceivedMessage = comPortSendAndReceive("My send message");
if (myReceivedMessage != null)
{
MessageBox.show("Received the following message: " + myReceivedMessage);
}
else
{
MessageBox.show("Timeout when reading message");
}
}
}
class ComPort
{
private SetStringDelegate stringReceivedDelegate;
public void connect(string comPort, SetStringDelegate stringReceivedDelegate)
{
this.stringReceivedDelegate = stringReceivedDelegate;
}
public string comPortSendAndReceive(string stringToBeSent)
{
try
{
System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
}
catch (ThreadInterruptedException)
{
}
}
private void port_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
}
}
Any advice on how to solve my problem will be greatly appreciated.
|
|
|
|
|
I'm no expert on threading but I believe it's better to use the System.Threading.Monitor class[^] in this situation as while it's waiting it can be pulsed from another so it wakes up.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
Hi Arnold
You've already found the problem: you should never block the UI thread.
Put the call to comPortSendAndReceive in a new thread and let the UI thread continue pumping messages.
Also, using Sleep and Interrupt is a fairly nasty way to synchronize your threads. You might consider using a WaitHandle , probably an AutoResetEvent , instead. This has a Wait overload that takes a timeout, so you don't need a timer any more.
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
Thanks for your input. So basically, it is impossible to write an updateGuiImmediatelyWithTheWrongThread()-method?
|
|
|
|
|
arnold_w wrote: it is impossible to write an updateGuiImmediatelyWithTheWrongThread()-method?
Yes, windows controls must be used from the thread that created them: the UI thread.
I think the way to do this is to implement a queue. When the button is pressed, put a command in the queue and let the UI thread return. Then have a background thread that takes commands from the queue and processes them. You don't want to create a thread for each command. Then publish an event or two for the UI to listen to, and use them to report back progress and completion status.
If you want professional advice with this, or someone to write it for you, please use the email link below this message to contact me directly.
If you want to learn about multi-threading, there is an excellent ( free ) ebook by Joseph Albahari here[^].
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
Ok, thanks for your advice and the useful link.
|
|
|
|
|
Dear Friends,
I created a dataset and it contains value. For programming reason I assigned the dataset to a object variable
Now my problem to convert this objects variable back to dataset.
When I tried I get invalid type conversion.
Kindly give me your suggestion.
Thanks in advance
Regards
Santhosh
|
|
|
|
|
Did you try this?
DataSet dataset = myObject as DataSet;
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanks for help but I get object reference not set - error
|
|
|
|
|
First, don't vote posts a 1 if the person is trying to help you. That will do nothing but keep people from trying to help you in the future.
Second, if you want help, you're going to have to be a LOT more descriptive. What object threw that exception? Have you tried using your debugger?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi,
I need to specify polygon(s) based on gps coordinates and calculate if a gps position is inside the polygon or not. any idea how to do it?
I found a method where polygons can be specified based on Points (integer) but gps coordinates are float.
will really appreciate
regards,
rnv
|
|
|
|
|
Have a look at the graphics class, the DrawPolygon method is overloaded. This first takes an array of Points (ints), the second takes an array of PointFs (floats).
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
There are 2 standard algorithms for calculating if a given point falls inside a polygon (see here[^]) The ray casting is probably the simplest. You will need to read up on how to calculate the intersection points of lines. Watch out for the special cases, such as when the point falls exactly on one of the vertices or edges, or if the ray you cast exactly crosses a vertex.
.net 3.5 has a System.Windows.Shapes.Polygon class which contains a Points member, which holds a collection of System.Windows.Point objects which use 2 doubles to store the point. These classes are for WPF drawing though, so if you are only interested in the calculations and don't plan on drawing the shapes, it is probably way more complex (and larger) than you need.
Best bet is probably to define your own Vertex class which holds 2 double values and your own Polygon class which holds a collection of Vertex objects.
Simon
|
|
|
|
|
Look for the SQL Server 2008 Feature Pack - It contains a bunch of assemblies so you can use the new types in your .NET application (you don't need SQL Server to use the assemblies). Find the new SqlGeography object, create a polygon with it (It is OGC Standards compliant) and then perform an STIntersects with another SqlGeometry that represents your GPS point. It will tell you if your point is in the polygon or not. It also takes into account the curvature of the earth.
Something like this:
SqlGeometry polygon = SqlGeometry.STGeomFromText("POLYGON(( <polygon definition here> ))");
SqlGeometry point = SqlGeometry.STGeomFromTest("POINT( <point definition here> )");
if (polygon.STIntersects(point))
{
}
else
{
}
|
|
|
|
|
hi all,
i have a button control in normal windows form application and i have another application in which i placed a panel . I want to drag the button from one aplication and drop this button control to the panel of the another application.
can anybody help me to solve the problem.
Thanks & Regards
aiswarya.
|
|
|
|
|
You will have to look into dragging and dropping through Windows API.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Hi all,
I can delete the selected rows from datagridview by selecting the rows and pressing the del key:
SqlCommandBuilder cb_imp = new SqlCommandBuilder(myda);
myconn.Open();
myda.Update(mydt);
Bud what's the way to delete all rows without selecting???
Thanx.
|
|
|
|