|
nope!
i'm so sorry that caused you think that way!
i mentioned in my post as you locked! and i told no matter if it ask the user for connecting to internet
Trojans ask users ? "Hi dear user i wanna steal your information can you please connect to internet cause i want to send your passwords and any of your pressed keys that i stored before! ha ?"
no my dear friend this application not virus,not Trojan, not anything bad else! but if you wondering to know that if i designed a virus and Trojan and a key logger and so more all in a little tiny program, my answer is yes! and in that application that was not necessary to connect to internet, it waits and when the user connected to internet then sends the information. this is for your interest!
i'll be so glad if you answer my pretty safe and legal question and if you don't know just follow this post maybe you can learn a little some more!
best wishes
|
|
|
|
|
Hi,
I am writing a small application that is used to investigate log files. Currently our QA teams are using TextPad for this task. My goal is to create an application that will be able to filter and search the log text for preset expressions.
The size of a typical log file is 2 - 3 MB, and contains about 30,000 lines.
I am using RichTextBox so I will be able to format text. I am using a StringBuilder to concatenate all the lines (note: I am using '\r\n" after each line). I then set the content of the stringBuilder to the RichTextBox:
textBox.Text += sb.ToString();
This causes the application to freeze. I tried SuspendLayout / ResumeLayout but as soon as the form is displayed the application freezes.
Limiting the lines to 10,000 prevents the freezing.
Any ideas?
|
|
|
|
|
Try adding the rows to a string collection. Although it's essentially what StringBuilder does it may help isolate the problem. i.e. is it StringBuilder or is it the TextBox that is causing the hangup.
List<string> lines = new List<string>();<br />
lines.Add(...)<br />
textBox.Text = string.Join("\r\n", lines.ToArray());<br />
only two letters away from being an asset
|
|
|
|
|
Do you need to display all the 30.000 lines, or can you suffice with the first 10.000 and a small warning label that says "only showing first 10.000 items"?
If the answer is "no", do your users need the ability to "edit" the text inline? If they don't, then consider using HTML for markup and showing it in a WebBrowser.
..or use a paging-pattern, where the user can view a limited amount of text on each page.
Good luck
I are troll
|
|
|
|
|
Hi,
IMO TextBox and RichTextBox are not the right choice for displaying thousands of lines of text. The reason is they need all text concatenated, and any change you apply needs to create a new huge string with new mark-up commands.
When text is line-oriented, hence does not need word wrapping, I tend to use a ListBox. That is a Control that holds a collection of strings, each representing one line of text. It does not mind holding millions of lines. By default a ListBox shows text in one font, one size, one style, one color; however it is rather easy to use the DrawMode.OwnerDrawn, so one can color each line individually (or do anything more fancy yourself) in the DrawItem event. Here is an example[^].
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.
|
|
|
|
|
Yoav Ben Zvi wrote: contains about 30,000 lines
Not something I've done, but if I were in your situation, I would consider subclassing the RichTextBox and adding some kind of virtual mode so it only has to deal with a small percentage of those lines at once - much like you can do with a ListView.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
I understood that you want to have it read-only.
Probably discarding the TextBox and replacing it with e.g. a ListView [^] control in virtual mode [^] or a Data grid[^] (with one column then) would be the best way to go.
Or e.g. use a WebBrowser control to show the text.
|
|
|
|
|
Thanks for the replies. I experimented with the ListView - 30,000 thousand lines with no problem. Since most users will probably apply some heavy filtering, there shouldn't be any problem. I don't even have to use virtual mode.
I'll try out the datagridview to see which is easier to use.
|
|
|
|
|
Hi,
I need to know Split method of string. I have data in the string variable like following and i need to know, how may I split and directly convert into Arraylist or Dataset or DataTable ?
kindly give method with sample commands.
Thank you very much in advance
Sample Data
===========
apple,500,15.50,0000010105,good,A001
(Riaz)
|
|
|
|
|
MSDN[^] not good enough for you?
/ravi
|
|
|
|
|
You already know it's called Split , so what is your question?
|
|
|
|
|
string sample = "apple,500,15.50,0000010105,good,A001";
string[] sp = sample.split(',');
output:
sp[0] = "apple";
sp[1] = "500":
sp[2] = "15.50":
sp[3] = "0000010105":
sp[4] = "good";
sp[5] = "A001";
|
|
|
|
|
I guess he needs one step further. The requirement is to get an ArrayList, here's code snippet -
string sample = "apple,500,15.50,0000010105,good,A001";
string[] sp = sample.Split(',');
ArrayList arr = new ArrayList(sp);
foreach (object item in arr)
{
Console.WriteLine(item);
}
Hope this would help. 
|
|
|
|
|
Arindam Sinha wrote: ArrayList arr = new ArrayList(sp); foreach (object item in arr) { Console.WriteLine(item); }
no need for reassigning it in ArrList
we can use like this..
for(int i=0;i<sp.length-1;i++)
{
console.writeline(sp[i]);
}
<div="" class="ForumSig">Padmanabhan
My Articles:
Articles[^]
My latest Article:
Word Automation[^]
|
|
|
|
|
Yes I know. It was done only for the original request. He needs an ArrayList. 
|
|
|
|
|
Thank you very much friend
|
|
|
|
|
|
Hi!!
I'm doing a small application, but do not know how to get the path of a folder when click right this folder(as cut,copy of windows).
Help me. Thanks!!!
|
|
|
|
|
You have to give a little more detail. How are you listing the folders? Is it a listbox, treeview???
only two letters away from being an asset
|
|
|
|
|
Not sure what you mean. If you are copying from Windows Explorer, the clipboard would hold a description of what you copied/deleted in various formats.
Clipboard.GetFileDropList() or Clipboard.GetText() might fit your needs.
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.
|
|
|
|
|
When I add a new connection string in my .setting file it brings up a nice Connection Manager screen, which allows me to select the appropiate setting for my connection. I was just wondering if anyone knows how I could bring this screen up once my app has been installed at the client. To make it easier for him to select the connection string.
Thanks.
|
|
|
|
|
Your requirement is not clear to me.Why do you want your end user to put the the connection string?
In general, the end user should only install the application (I am assuming it's a desktop application). If you are working on a WebApp,then end user does not have that choice as the application would be in IIS server.
The screen that you get that's a feature of Visual Studio.
|
|
|
|
|
If you feel that you really must do this, although it credits your users with more smarts than the average, download the SQLServer2008/2005 samples from here[^].
In the programmability part there is a sample called ServerConnect which does a pretty good imitation of a Connection Manager.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
i want to create a C# win app that allows the user to enter in a text box some data and press send..
the data in the text box will be sent to the web app (server side) and store this data in a text file on the web app.
thx!!
|
|
|
|
|
You should be using a database. The windows app would write to the database and the web app would read from it to display.
only two letters away from being an asset
|
|
|
|