|
I think the problem is the following line:
currNode.Text = (node2Iterate.OuterXml).Trim(); Use the LocalName property instead of OuterXml .
"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." - Rick Cook www.troschuetz.de
|
|
|
|
|
thanks alot for your reply, that fixed my problem
|
|
|
|
|
As I using Adobe Flash as a part of my web application UI,
I really want to simulate somekind of bandwidth when I develop Flash and Server on one PC.
For that ,
I would like to write a windows form to throttle and monitor Flash's(or other appliaction's) bandwidth.
But I dont know how to implement this idea using C# just like Webspeed Simulator(http://www.xat.com/wo/index.html)
### Thanks, Nader Elshehabi ###
But in some condition, I publish my project as a stand-alone one(a .exe file) or writing C# windows form chat client.
-- modified at 22:25 Monday 2nd October, 2006
|
|
|
|
|
Hello
You can do something like a bottle-neck for your WebBrowser. Here is my suggestion:
1- Make a windows Form.
2- Inherit a class from WebBrowser class. Lets calld in WebSim.
3- In WebSim, Handle the Navigating event, and get the new URL yourself.
4- Get the document stream, and load the document yourself. Use Thread.Sleep() method to delay loading ebtween requests according to the speed you desire.
5- Display the document, either as the usual way -part by art as loaded- or when it's fully loaded.
NB.
I haven't tested the above suggestion thoroughly, so it might not work. Otherwise you'd have to write your browser from the scratch using HTTP requests.
Regards
|
|
|
|
|
hi
i use VS2005 .
i have a form that has a Panel and many labels,Textboxs Controls .. in runtime, User fill this Textbox and print it, But how to printpreview and rint this form correctly ?? (because many controls in Panel ,The panel scrollbar appear in Printpreviewdialog(in one article in codeproject)).
thanks ..
|
|
|
|
|
Hello
In CodeProject there are two printing articles that I know of capable of doing this.
One of them I wrote[^], and might cause the problem you are talking about. In this case -and until I update it and fix this issue-, you have to print each control alone.
The other is this article[^], which I think solves your problem, but loses the visual styles.
Regards
|
|
|
|
|
|
hi S. Senthil Kumar
i could not access this component from your link ..
http://blogs.msdn.com/brada/archive/2006/09/23/768683.aspx
Please give me another link for download this component.
|
|
|
|
|
This[^] should work fine.
|
|
|
|
|
(first.....finally. For some reason the forum was making me re-verify my email address. Took like 2 hours for the confirmation msg to reach my inbox)
Anyway...I have a personal project going right now where my application links into several different modules that I've already made. The issue I have is that I have a standard way of handling database connectivity. I encapsulate my database connection and my result set into 2 classes: clsDatabase and clsQueryResults. For each of the individual projects, I've included these 2 classes and made the manipulation methods (i.e. open, close, beginTransaction, commit, rollback, ExecuteQuery) internal for security reasons. But now I have multiple definitions of these files located in each of the 3 modules that interface with the same database. I don't want to maintain each of them in their individual contexts. I want to be able to pull the clsDatabase and clsQueryResults out into a distinct component, but I am stuck on maintaining the integrity of the database. Once the classes are removed from the components, they can no longer access the internal methods located in these classes and making them public is not an option. Does anyone have suggestions to solve this issue?
[edit] To Clarify:
I would like clsDatabase to still be exposed to each of my projects, but not to the UI. Currently clsDatabase is maintained inside each of the projects and I would like to pull it out so I don't have to maintain multiple concurrent database connections to the same database inside the same instance of the program that can potentially attempt to manipulate data in the same table. So, I would like to pull clsDatabase and clsQueryResults out of each of the projects, place them in their own logical layer between my projects and ADO.NET and allow the projects to make direct calls to them with the caveat that they cannot be exposed to the UI. Does anyone know of an elegant solution to this issue? (Feel free to completely dispose of my logical design if you can formulate something that would work)
-- modified at 3:53 Tuesday 3rd October, 2006
|
|
|
|
|
Hi everyone,
Actually, I got some problems to achieve the desired result for my application. Three problems which are:
1 - Restricted and access to any form which under the new popup window (For example: when you open the save dialog, you couldn't do anything unless to save your file or cancel the saving operation. I want to do the something to my popup window.
2 - I have MdiParent form and another normal form, the MdiParent form will appear first, then I Initialized the second one but its appeared under the MdiParent form. How can I change the order of forms?
3 - The last one, I want to add a pie chart that analyzes the data inside dataGridView in the same form. How can I do that?
Thanks in advance.
Digital.Hand
|
|
|
|
|
1. You want to make your form modal. You can do this by creating the new form and then calling "ShowDialog()" and that should do the trick.
|
|
|
|
|
Hello
1- Use Form.ShowDialog() , and you can get DialogResult as the return value.
2- If you mean by "under" that the second form appears behind the MDIParent, use Form.BringToFornt() . otherwise, please elaborate.
3- Search the articles[^].
Regards
|
|
|
|
|
Really, thanks a lot (Andrew & Nader ).
|
|
|
|
|
Having done a search both here and google I have found a ton of information about using HttpPostedFile. I have a situation where users will be uploading drawing files. Most of the time these files will not be very large, there are however those few people that continue to use Solidworks and create files that are 100Mb and up. Now I would just increase the max Http Request length but considering that I could have several people trying to upload huge files at the same time...this could get me in trouble.
I am not sure what to do...I am not able to use any 3rd party plugins or activeX controls...
Any ideas would be great....
Thanks,
Will
I hate users. Not all of them, just the ones who talk.CP member: Al Einstien
|
|
|
|
|
Hello
AFAIK the best practice in transfering a file over a network is making it in chunks. This would give you two advantages:
1- Minimize data loss, and improve recovery.
2- Allows the user to resume uploading/downloading files later if there is a connection failure.
I wouldn't like it if I lose my 99Mb upload for a 2 secoinds power failure.;P
Regards
|
|
|
|
|
hi guys,
this question related to my previous post:
Link
The current problem is redirecting the output to a textbox...
there is the issue of a thread different from form's thread, trying to access the textbox.text property (i've read an article in msdn, i which they query the invokerequired property of the textbox and invoke it same method using this.invoke, but it doesn't seem to solve the problem)
again, i want to start a new process and redirect its output to a textbox at runtime (every line of text written by the process should be written at runtime at the textbox, without waiting for the process to finish)...
the answer in the first reply i got helped, but i couldn't make it thread safe (and in the buttom line i think it wrote the output to the textbox, but the window couldn't refresh itself until the other process has finished...
any suggestions?
Thanks in advance,
Erik.
|
|
|
|
|
Hello
Your problem -I presume- is that your thread waits for the process to finish until it views the output in the textbox? You should use Process.BeginOutputReadLine() method, and it should work fine. If you are using it, what seems to be the problem again?
About the Invoke() , it should also work fine if you use the Process.BeginOutputReadLine() method. If you still can't get it right post your code and maybe we could work it out.
Regards
|
|
|
|
|
you are familiar to "..." block same as my first reply
...
System.Diagnostics.Process pr = new System.Diagnostics.Process();
pr.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
pr.StartInfo.FileName = "cmd.exe";
pr.StartInfo.UseShellExecute = false;
pr.StartInfo.RedirectStandardInput = true;
pr.StartInfo.RedirectStandardOutput = true;
pr.Start();
pr.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(pr_OutputDataReceived);
pr.BeginOutputReadLine();
System.IO.StreamWriter swWriter = pr.StandardInput;
swWriter.WriteLine("echo SomeTextHere\n");
swWriter.Flush();
...
//Define a delagate function
delegate void SetTextCallback(string text);
//Define a function for setting
void SetText(string text)
{
if (this.textBox1.InvokeRequired)
{
SetTextCallback d = new SetTextCallback(SetText);
this.Invoke(d, new object[] { text });
}
else
{
this.textBox1.Text = text;
}
}
void pr_OutputDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e)
{
//event fired and u have data use it thread-safe
SetText(e.Data);
}
if this does not work define your problem with more details
UMS
|
|
|
|
|
Thanks for the replies guys, umseker thats almost exacly what i wrote...
the problem is that the window doesn't repaint itself until the other process has finished (i presume).
Anyway i'll post the code when i'll get home...
Erik.
|
|
|
|
|
Consider the code
DataTable dt = /* something */
double h_bid = (double)dt.Row[(int)SecurityColumns.BID];
double h_offer = (double)dt.Row[(int)SecurityColumns.ASK];
where /SecurityColumns.BID/ and /.ASK/ come from the enum type /SecurityColumns/.
Does the compiler determine before runtime the integer values of .BID and .ASK and make the substitution into the binaries? Or is the enum eval'd at runtime and converted to an int?
Execution speed is what I'm after. Thanks.
|
|
|
|
|
As the values of the enum is known at compile time, the values will be evaluated when it's compiled.
The compiler always evaluates everything that it can. For an example:
string msg = "Hello" + " " + "world!";
produces the exact same code as:
string msg = "Hello world!";
---
b { font-weight: normal; }
|
|
|
|
|
|
i am working with icodecompiler
ICodeCompiler compiler = codeProvider.CreateCompiler();
CompilerParameters parameters = new CompilerParameters();
it works well when i give it a cs form containing main function in it
but i want to build a form in which there is no main what should i do to achieve this
is it possible to do this without main if no then is there some way to add main at run time if the main is not there as in my case
|
|
|
|
|
Assalam-o-Alaikum,
i've compiled a classLibrary to generate a DLL. as you know classLibrary doesnt have a main method,
i used a switch "/target:library".
parameters.CompilerOptions="/target:library";
there is also a method named MainClass in CompilerParameters class, i didnt use that but i think u can specify ur main class in it.
I hope this will help you
Allah Hafiz
-- modified at 4:29 Tuesday 3rd October, 2006
|
|
|
|