|
Load Testing on Memory?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Is this a 32 bit or 64 bit application? A 32 bit application can't address more than 2 GB of memory.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Hi, all.
If anyone knows of any articles or web sites that go into detail of a 'high score system' or internet usage (like a simple multiplayer game where you can chat) I'd be greatly appreciative. Also, if anyone could tell me how to publish a program... Step 1) Zip up contents - what are all the contents? Step 2) eMail content???
Thanks!
- I love D-flat!
|
|
|
|
|
Hich scores can be stored whereever you like, the registry, XML, a flat file. It's up to you. Any internet based stuff is going to revolve around a central server that at a minimum acts as a hub to allow players to find each other, even if traffic after that goes direct between the players.
To deploy a program, you're better off creating an installer, which also means it can enforce the need for the .NET framework.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi
i want, search in network for online computers by this code :
System.Diagnostics.Process pr = new System.Diagnostics.Process();<br />
System.Diagnostics.ProcessStartInfo pstart = new System.Diagnostics.ProcessStartInfo("cmd.exe");<br />
pstart.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;<br />
pstart.UseShellExecute = false;<br />
pstart.RedirectStandardOutput = true;<br />
pstart.RedirectStandardInput = true;<br />
pr.StartInfo = pstart;<br />
pr.Start();<br />
System.IO.StreamReader reader = pr.StandardOutput;<br />
System.IO.StreamWriter writer = pr.StandardInput;<br />
writer.WriteLine("net view");<br />
writer.Close();<br />
StringBuilder sb = new StringBuilder();<br />
<br />
while (!reader.EndOfStream)<br />
{<br />
string line = reader.ReadLine();<br />
if (line.StartsWith("\\"))<br />
{<br />
line = line.Replace("\\", "");<br />
sb.AppendLine(line.TrimEnd(null));<br />
}<br />
}<br />
this.textBox1.Text = sb.ToString(); <br />
pr.WaitForExit();<br />
pr.Close();
this code work correctly, but my problem is that when i set UseShellExecute property to false, this line of code :
pstart.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
does not work and cmd.exe was shown, how to solve this problem and prevent from show cmd.exe ?
thanks
|
|
|
|
|
AFAIK you can't. There basically are two kinds of apps:
- Windows apps, they can create and show a form, but they can not perform input/output in a
console window (such as "Command Prompt").
- console apps, they can create and show a form, and perform console input/output; when launched
inside a console (as a DOS command) they use that console; when launched outside, they create
a new console (which you can hide afterwards, but it WILL initially show no matter what).
cmd.exe is clearly a console app.
|
|
|
|
|
hi Luc Pattyn
in win app, when u start cmd.exe from your app, u can set input/output to your app(did u test my code ?), but my problem is not that, my problem is that how to prevent to display command prompt when i run cmd.exe with useSellExecute set to flase.
thanks
|
|
|
|
|
Try setting CreateNoWindow property to true.
|
|
|
|
|
thanks.
my problem was solved by your suggesstion.
|
|
|
|
|
You are welcome
|
|
|
|
|
Greetings,
Mostly I use enumerations to specify a list of constants that are connected.
However, recently I needed to create a code that does the following:
Paint a line with a specific color that is set by the value of the bits in a variable.
The bits values are arranged in enumeration:
enum bits
{
Switch1 = 1,
Switch2 = 2,
Switch3 = 4,
switch4 = 8,
}
What is the best way to assign a color to each switch?
I thought of two ways:
---------------------------------------------
creating a dictionary and set its values in runtime:
Dictionary<bits, color=""> Bits_Colors = new Dictionary<bits, color="">;<br />
<br />
Bits_Colors.Add(switch1, Color.Red);<br />
Bits_Colors.Add(switch2, Color.Ivory);<br />
..</bits,></bits,>
But this solution because the dictionary is not constant and readonly would not help here.
-------------------------------------------------
Creating another enumeration for the colors and using thier names as params to Color.
<br />
enum BitsColors<br />
{<br />
Red = 1,<br />
Ivory = 2.<br />
Blue = 4,<br />
Green = 8<br />
}<br />
<br />
string name = Enum.GetNames(bits, (int) switch2 );
Color c = Color.MakeByName(name);
-----------------------------------------------------------
I wrote the code from my memory so it might be a little not working.
Sincerely yours
Y.R.
|
|
|
|
|
How about an array ? A constant array of colors, and you reference it by index, using the value that is the combination of your bit values.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks for your reply.
I thought of that but there are two problems:
First, I don't think there is an easy way to make array a contant (except for basic types arrays).
Second, my bits values are not 1, 2, 3, 4... (which would fit to an array).
They are 1, 2, 4, 8, ... (Which requires some logic to be implemented in an array).
I thought of constant dictionary but I don't think there is a way to make the dictionary constant or readonly.
Sincerely yours
Y.R.
|
|
|
|
|
You could use attributes, but the code can be verbose and (perhaps) inefficient.
I'd stick with the readonly static Dictionary idea; wrap it in something so the code that uses it can't change it.
|
|
|
|
|
I thought that this is the only way.
It strange that such a powerful language don't have this simple features.
Thanks for your help.
Sincerely yours
Y.R.
|
|
|
|
|
Microsoft tends to do the hard stuff and leave the easy stuff to you. (Which is better than the other way around.)
|
|
|
|
|
How to load HTML file using XmlDocument class
I try to do
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.Load(path);
but html document not considered by doc.Load method like regullar xml document since what have some unclosed tags such as an other unwell formated things(<link)>Can i actually load this html file by using System.Xml.XmlDocument() for purpose transform this HTML file into an XML file by using XSLT.
THANK
|
|
|
|
|
As you have found, not all HTML documents are XHTML. Therefore, a DOM class will not load them. An XSLT can generate non XML documents, but it cannot work with documents that are not XML to start with, you need a different solution.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
HTML doesn't conform to XML standards. However XHTML does. The following text comes from the Wikipedia article for XHTML:
Whereas HTML is an application of Standard Generalized Markup Language (SGML), a very flexible markup language, XHTML is an application of XML, a more restrictive subset of SGML.
A solution to your problem would be to convert your HTML code to XHTML which can be understood by the XML parser. I'm not aware of a component that can do this. However this article[^] explains the processes involved.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Personally, I do use SgmlReader[^].
In addition you could use my Zeta Html Tidy[^] library.
I am using both, SgmlReader andy Zeta Html Tidy, together in some projects.
|
|
|
|
|
|
hi
i have datagrid, i pick some records (CTRL + rows)
i want to run over the datagrid and to read only the
rows that i pick
how can i do this ?
thank's for any help
|
|
|
|
|
|
I use below code to fill the DataAdapter with a table contents, but the table name contain space such as "Table Name" I am using replace method to elemnate space from the table name to become "TableName" because when filling DataAdapter it returns an error and even with using the replace method I receive an error such "Syntax error in query. Incomplete query clause."
private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
{
DataSet1 ds = new DataSet1();
string stconn = "connection string";
OleDbConnection conn = new OleDbConnection(stconn);
string deletespace = this.treeView1.SelectedNode.Text.ToString();
string Deletespace = deletespace.Replace(" ","");
OleDbCommand command = new OleDbCommand("select * from '" + Deletespace.ToString() + "'", conn);
conn.Open();
OleDbDataAdapter Adapter = new OleDbDataAdapter();
Adapter.SelectCommand = command;
Adapter.Fill(ds, Deletespace.ToString());
}
hawari
|
|
|
|
|
Wow.
ahawari09 wrote: string Deletespace = deletespace.Replace(" ","");
Why create a new string ?
ahawari09 wrote: Deletespace.ToString()
What do you think 'ToString' does when called on a string ?
ahawari09 wrote: ("select * from '" + Deletespace.ToString() + "'", conn);
Why are you putting the table name in quotes ?
ahawari09 wrote: conn.Open();
OleDbDataAdapter Adapter = new OleDbDataAdapter();
Adapter.SelectCommand = command;
Adapter.Fill(ds, Deletespace.ToString());
Why don't you close the connection ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|