|
There is the notion of sparse files and an fsdisk utility[^]
and a FileAttribute.SparseFile that sound good.
It is intended to skip sectors that would contain just zeroes, and is supposed to
work on some file systems only (NTFS yes, FAT no).
But I cant get it to work at all, it wont even keep the flag set (as opposed to hidden,
which gets accepted).
Luc Pattyn
|
|
|
|
|
hello
how can load one file to RichTextBox?
|
|
|
|
|
that would be simple for google.
By the way google is smart more than us, you can try asking it from time to time for basic questions like this
|
|
|
|
|
richtextbox has a property called Text which you can use to fill richtextbox with the strings.
richTextBox rtb = new richTextbox();
rtb.Text="hello";
|
|
|
|
|
|
Hi,
If its just the file you need to open and view the contents into a RichTextBox, you can use the OVERLOADED LoadFile() function which accepts a filename (filepath) as a string and a RichTextBoxStreamType as an another parameter
Eg.
this.richtextBox.LoadFile("c:\\temp.xxx", RichTextBoxStreamType.RichText).
The RichTextBoxStreamType.RichText should be used , if the cile to be opened in the RichtextBox is of RichTextType.
Refer MSDN for other flavors of RichTextBoxStreamType ENUM.
Thanking you in Advance
Regards
Pratik Shah
|
|
|
|
|
another good guy with goooooogle
You can load multiple files into RichTextBox one simple way :
load the files into separate buffers (dont use RichTextBox.LoadFile or something)... and then set's these buffers with the += .. :
System.IO.TextReader tr1 = new System.IO.StreamReader("filename1.txt");
string s1 = tr1.ReadToEnd();
...
richtextBox.Text += s1;
and so on
VirtualVoid.NET
|
|
|
|
|
Hello,
I am implementing a FileSystemWatcher to watch a directory for changes. The code that I wrote was as follows:
private void setupDirWatcher(string thePath)
{
FileSystemWatcher aWatcher = new FileSystemWatcher();
aWatcher.Path = thePath;
aWatcher.NotifyFilter = NotifyFilters.LastWrite;
aWatcher.Changed += new FileSystemEventHandler(aWatcher_Changed);
aWatcher.EnableRaisingEvents = true;
}
This is called once to do the setup and the intent was to have a watcher on a particular directory.
But I don't understand why this would ever work. It would seem to me that since aWatcher is a local variable and should go away at the end of the method, then the watcher shouldn't really work. I realize that 'new' is called here, but I don't see how this has any lifespan outside this method. What I see is that the event handler gets called several times, as changes happen in the directory.
I would have expected that aWatcher would need to be a class member for this to work. Is it just a coincidence that this works or am I missing something here?
Thanks,
Matt
|
|
|
|
|
The FileSystemWatcher instance is not collected by the garbage collector because of the event handler that is registered to the Changed event.
"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
|
|
|
|
|
Thank you for your response. It was helpful.
Matt
|
|
|
|
|
The life span in C# is a lot different than in C/C++ or other non-garbage collected languages. The "aWatcher" is a pointer to the created instance, and that pointer will expire when the method is finished, while the lifespan if the instance will be as long as, in easy terms, "somebody knows where it is".
Internet - the worlds biggest dictionary
|
|
|
|
|
So in this case, the watcher instance's lifespan is until either the program terminates or I explicitly unregistered the event handler at some point later in the code and I guess that would need to be in the specified callback method itself since I don't actually have a way to get to that watcher instance once the setup method is done.
Thanks for the clarification on this.
|
|
|
|
|
Correct. Generally if you need to unregister an event handler you need to save the needed instance information in class variables.
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
OS :XP
Visual studio 2003
controls . RichTextbox
I have two richtextbox one is input and
other one is display.
I place some text in input then added
it will show in display window.
In display richtext I could not find the last send item.
the scroll is on the top
How can bring the scrollbar to down in run time.
for shwo the last send item from input richtext.
anybody help me
Continue...
|
|
|
|
|
textBox.Select(textBox.length, textBox.length);
i guess that will work
|
|
|
|
|
Hi
Is there any column like datagridDateTimePicker in vs-2003 version?
sivamyneni
|
|
|
|
|
FlexGrid can do something like this (www.componentone.com)
VirtualVoid.NET
|
|
|
|
|
didnt get anything from that
sivamyneni
|
|
|
|
|
you can code the customeditor(s) in that control (flexgrid)... there are a lot of good examples and explantations
VirtualVoid.NET
|
|
|
|
|
hi,
thank you.i got it.
sivamyneni
|
|
|
|
|
Hi Code project people,
can anyone help me out with how to page table control?
will be expecting your responses.
thanks in advance.
|
|
|
|
|
AFAIK you can't. Take a look at the DataGrid instead.
"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
|
|
|
|
|
how can i open(visualize) a System.Windows.Forms.MenuItem of System.Windows.Forms.MainMenu by code?
jaye
|
|
|
|
|
if this menuItem has other menuItems under it you use the following statment
<br />
menuItem1.ShowDropDown();<br />
if it doesn't have you show use the above statment on its parent menu item
|
|
|
|
|