|
For local machine, these details can be obtained through Win32 classes[^]. Don't know if you would be allowed to fire the queries on other machines in the network.
|
|
|
|
|
Thanks for reply..
u r right, but when i get all computer name of domain then i have passed Username & Password. then i would like to fetch hardware configuration by using domain username & password.
|
|
|
|
|
I have to get CPU weightage and RAM weightage and Disk IO weightage for Load Balancing in TFS2008 for Build,Deploy and Test Progress. I foungd the Below Formula to find that.
Host Rating = (Free CPU * CPU Weight) + (Free Memory * Memory Weight) + (Free Disk * Disk Weight) + (Free Network * Network Weight)
But I dont know about the CPU Weight,Memory Weight,Disk Weight and Network Weight.
How can I get the all details .
If any c# code is there to find that......
|
|
|
|
|
Point[] pts = new Point[]
{
new Point(100, 300),
new Point(200, 200),
new Point(300, 100),
new Point(400, 300),
new Point(500, 100),
new Point(600, 300),
new Point(700, 500),
new Point(800, 200),
new Point(900, 300),
};
GDI.Graphics.DrawCurve(Pens.Red, pts, 0.5f);
Hello i am drawing a curve using the Graphics.DrawCurve method but i cant seem to find a way of changing the Thickness/Width of the line that draws the curve . Is there an alternative function for changing the curve Thickness/Width ?
|
|
|
|
|
Hi,
how would you do it with paper and pen?
Just take a thicker pen, look at the various constructors.
And don't forget to look at some of the Pen properties, which may become relevant when you choose a wider pen.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
We don't all have wide pens.
|
|
|
|
|
If you don't have a wide pen, use a regular pen and do a convincing Parkinson act.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
We do have. Check these:
Pen oPen = new Pen(Brushes.Black, 2);
Pen oPen = new Pen(Color.Black, 2);
|
|
|
|
|
If it were that easy I wouldn't get so much spam.
|
|
|
|
|
I have two file list that I would like to combine into one using an index;
private List<string> fileList = new List<string>();
private List<string> fileList1 = new List<string>();
How would you define the declaration?
Thank you in advance
modified on Thursday, July 2, 2009 10:15 PM
|
|
|
|
|
Not 100% sure what you want to achieve - do you want to end up with a single list containing the strings from both lists, or some sort of 2 dimensional array?
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
Hello,
I have two file list that are used in multiple places in the project.
One list is for a master list of files.
The second is for a "checked out" list of files.
It would be great if I could access them as fileList[index]
- index = 0 for master
- index = 1 for checked out.
This way I can use the same routine for searching and processing.
Thank you in advance
|
|
|
|
|
O, I see. There is nothing two-dimensional about that, it is just two normal lists, which you may or may not store in an array, i.e.
<code>List<string>[] twoLists=new List<string>[2];
twoLists[0]=new List<string>();
twoLists[1]=new List<string>();
I don't see much potential benefit from putting both lists in one array though, as you are going to pass one or the other to some methods. Keeping them separate allows you to use more meaningful names.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Or use a Dictionary<String,Boolean> and use the boolean to indicate checked out.
|
|
|
|
|
Great. I like that, a dictionary to get one attribute for free.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Hi,
if you want one large List that contains all elements, have a look at List.AddRange
if you want a real two-dimensional list, there is no such thing; in .NET collections such as List and Dictionary are one-dimensional.
if you want the equivalent of a jagged array, you can build a List<List<string>> and append elements to each row of such pseudo 2-D structure.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Hello,
I am using the following bat file to install my application on a user computer. However, the client want to be able uninstall the application if the application is installed, and then install the new version of the application.
However, I have 2 problems.
1) how can I detect if the application is installed or not?
2) If it is installed, how can I uninstall it?
The application is a C# 2005.
Many thanks for any advice,
@ECHO OFF
:: Copy the configuration file
copy config.xml "%AppData%\DataLinks.xml"
:: Search for the CONFIG file, if this doesn't exit then the user doesn't have the .Net framework 2.0
SET FileName=%windir%\Microsoft.NET\Framework\v2.0.50727\CONFIG
IF EXIST %FileName% GOTO INSTALL_DIALER
ECHO.You currently do not have the Microsoft(c) .NET Framework 2.0 installed.
ECHO.This is required by the setup program for CAT Dialer
ECHO.
ECHO.The Microsoft(c) .NET Framework 2.0 will now be installed on you system.
ECHO.After completion setup will continue to install CAT Dialer on your system.
ECHO.
:: Install the .Net framework and then run setup to install the CAT Dialerr
PAUSE
ECHO Installing... this could take serveral minutes...Please wait....
START /WAIT NetFx20SP2_x86.exe
:: If the user cancels the installation of the framework exit batch file
IF errorlevel 1 GOTO EOF
Start CATSoftphone.exe
ECHO ON
EXIT
:: .Net framework has been skipped contine to install the dialer.
:INSTALL_DIALER
ECHO *** Skiped Dotnet Framework 2.0.50727 ***
ECHO Installing... Please wait...
START CATSoftphone.exe
ECHO ON
EXIT
|
|
|
|
|
I am not very sure why you are trying to install through the batch file.
You can very much use a setup project to accomplish this. If you have it installed already, then it wil prompt you. Anyway, please find the details of
Seup Project[^].
If you ask my opinion, I would suggest you to try ClickOnce[^] installation which has many advantanges over MSI installation.
|
|
|
|
|
A lot of code I have come across recently has
If (null == something)
whereas I tend to write
if (something == null)
which seems to me to be much more logical and easily readable -
So the question is, is there a good reason for using the former over the latter?
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
Hi,
the origin is it protects you against a typo where you drop one equal sign; then constant=variable yields an error, whereas variable=constant may not (it wouldn't in C/C++, it most often would in C# unless the types are bool). (*)
However, I am with you, it does not look good, and any decent compiler would normally (there are exceptions conceivable) generate a WARNING message, either saying: "are you sure that is what you intend?" or "condition will always be true/false". However MS compilers seem not to do so.
[ADDED] (*) which is another good reason never to write things such as if (someBool==true)... , just write if (someBool) ... .
[/ADDED]
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
modified on Thursday, July 2, 2009 8:10 PM
|
|
|
|
|
The "null == something" form (or in general, "<literal> == <variable>" form), is simply not useful in C# or Java.
The purpose of this form was to avoid accidentally typing an assignment rather than a comparison in C/C++. C# and Java will not let you make this mistake since the condition must evaluate to a boolean and a simple assignment will not (unless you compare the assignment to something).
David Anton
http://www.tangiblesoftwaresolutions.com
Convert VB to C#, C++, or Java
Convert C# to VB, C++, or Java
Convert C++ to C#, VB, or Java
Convert Java to C#, C++, or VB
|
|
|
|
|
_Maxxx_ wrote: is there a good reason for using the former over the latter?
There is, and AFAIK this reason comes from the good old C/C++ days. It was a very common error (the most common of all) to type if (reason = null) instead of if (reason == null) . This small little typo led to very strange program behaviour and was very hard to debug, because it's very easy to overread it when inspecting the code. The problem was that the C/C++ - Compiler didn't even issue a warning when you typed something like if (reason = null) , but it immediately complained about if (null = reason) .
So it's all about correctness and maintainability. I even saw companies with coding guidelines that dictated this style.
Regards
Thomas
www.thomas-weller.de
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. Programmer - an organism that turns coffee into software.
|
|
|
|
|
Yeah, what they said. It only works when comparing an Rvalue to an Lvalue, which isn't necessarily all that frequently, and my argument against it is that if I can remember to write it that way, then I will probably not make that mistake anyway so it's fairly pointless.
I worked for a company with the former specified in the company coding standard (for writing C), but by the time I left, even the "guru" (who had written the standard) had admitted that it wasn't that important and wasn't enforcing it.
|
|
|
|
|
So in summary, people used to do this in some other programming language, so have continued to do it in a different language, even though it serves no purpose, and indeed makes the code harder to read?
Sack 'em,. I say, Sack 'em!
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|