|
Martin# wrote: I also like this one!
Martin# wrote: But, you should allways dispose your process instances!!!
Yeah. I agreed with you.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Hi,
I was just wondering if anyone knows how to set the root folder for a DirListBox so that it is the topmost folder shown in this control.
Thank you heaps.
I am a SysAdmin, I battle my own daemons.
|
|
|
|
|
What's a DirListbox control? Is this a standard .NET WinForms or WPF control?
|
|
|
|
|
It is a control that appears in My User Controls and when it is added, its fully qualified name is:
Microsoft.VisualBasic.Compatibility.VB6.DirListBox dirListBox1;
I am a SysAdmin, I battle my own daemons.
|
|
|
|
|
Is this not what you want??
dirListBox1.Path = "d:";
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Hi (Judah and Michael)
Thanks for taking the time to answer my post. However I have tried your suggestion already. Say that my directory has:
D:\
|
|--Node1
| |
| |--Node1A
| |
| |--Node1B
|
|--Node2
I want the API or set of API's such that when I set the "root" through these as Node1, I will only see Node1 (as the root) and all its child nodes. The Path property sets the current selected folder but still has the drive letter as root and everything else visible.
Hope this makes my intent clearer? Regards y'all
I am a SysAdmin, I battle my own daemons.
|
|
|
|
|
Okay. I got your point..
I think, it can't be done with DirList control. So, I would suggest you to try with TreeView .NET control and DirectoryInfo..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Ah, ok. I'm not sure that the C# forum is the best place for this question then, perhaps VB.NET forum.
Just browsing the class in reflector, does the Path property do what you want?
|
|
|
|
|
well ma question.. im making a game in c#...
m using pictureboxes and i made array of pictureboxes...
m using 4 players images to move around the array from 1 to 100
problem is.. if a picturebox contains an image already and another player comes with the same number.. the first image vanishes and second overwrites it..
if.. an image already exists in the picturebox.. it should not overwrite it.. rather it should send the previous image to an arraylist probably and place the second one there, when second player moves it it retrieves it..
i dont know how to save and retrive that 1st picture present in the picturebox... m using gif files!!
plzzzzh help me out!!
its bout ma project.. plz be quick!
UMAIR
|
|
|
|
|
Hi,
PictureBox.Image is a property with getter and setter, so you can copy the reference
of the image a PB is holding, then set a new reference to show another image.
The image files (GIF) are not relevant; once they got loaded in memory, they all are
just images.
you do know that words such as urgent don't impress people overhere, and neither
does street language nor SMSspeak...
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Please read the forum guidelines. You should title your messages with some meaning. We don't care if it is urgent for you. Also stop using text speak.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
My application writes and reads file on disk. It works well, but sometimes, I meet an exception that warns: access to my file is denied. Please help me solve this problem. Thank you very much.
|
|
|
|
|
Are you closing the file properly?
If you leave the file open, it will eventually get closed when the stream object is finalized by the garbage collector. This may happen at any time, and would typically show the behaviour that you are experiencing.
Preferably you would use a using block to make sure that the file is always closed properly. Example:
using (StreamWriter writer = File.CreateText(@"c:\test.txt")) {
writer.WriteLine("Hello world.");
}
The StreamWriter (and the underlying FileStream ) will automatically be closed and disposed at the closing } .
---
single minded; short sighted; long gone;
|
|
|
|
|
Thank you very much for your help
|
|
|
|
|
Under what conditions does it sometimes fail ?
e.g. file just written and closed by app, then reopened to overwrite ?
or file just written and closed by app, then trying to delete ?
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I don't know exactly. Because with the same condition, my application runs in different ways. It works well, but after that, when I run it again, I meet exception. I don't have much experience about this.
|
|
|
|
|
Please help me more about this. My application reads content of a MP3 or WMA file to my own file (with another extension) . When I open my own file, my application create a new MP3 file which is the same as old Mp3. I can use Windows Media Player to play this new file, but sometimes WMP can not play this file. I can not understand. Please help me. Thanks in advance! Sorry for my bad English
|
|
|
|
|
Are you still getting the same error message? Have you made sure that both files are closed properly?
How do you create the new file? What does the code look like?
---
single minded; short sighted; long gone;
|
|
|
|
|
I have closed it. I read bytes of MP3 file throught an array, and then I use FileStream.Write to write to new MP3 file. It works very well, but sometimes, it cannot play new file, and I cannot understand the reason.
|
|
|
|
|
Are you still getting the same error message?
What does the code look like?
---
single minded; short sighted; long gone;
|
|
|
|
|
I run my application two times. The first time, WMP can't play the file, the message is the file is used by another application. But the second time, WMP can play it. I think may be the process of writing new file is not complete in the first time.
|
|
|
|
|
this may be bcz. u r not calling the close method of the streamreader class object (or whatever class u r using).
when u r finish with the file u must have to call the close method so that the file u r accessing is released
|
|
|
|
|
I have already closed Filestream.
|
|
|
|
|
You should paste the particular code so that we can be of better assistance.
I am fighting against the Universe...
Reference-Rick Cook
|
|
|
|
|
I'm sorry, I open and close file during my application, and i'm a newbie in C#, so my code is not clear.
|
|
|
|