I'm trying to get a file explorer on c# and I have found nothing about this. Is c# provide a file explorer already ready to work?
If not, is TreeView a good idea to create mine? Have you got some link to perform this?
Thanks in advance for these informations.
C# Doesn't provide file explorer tree as it is, but if you want to create a dialog for selecting the folder you can use FolderBrowserDialog(full dialog for folder selection)
However if you want to create one, yes, It is easy to do it with WPF TreeView.
As a hint
Take TreeView, write HiearchyDataProvider which provides files and folders and templates for each node to display icons and so on
P.S.
Simple google search shows a lot of ready-samples
Related
i want to know about the use of 'TextFile' item in wpf project-
1)I am Create a project in VS2010 .
2)write click on project(Or click on 'Project Tab in MenuBar')-->select 'Add New Item'--> in open dialog box,appear 'TextFile' option. see in picture.-
That's just a text file. It does nothing.
As with any other file, you are free to include it in your project as a resource, and perhaps load it at runtime via GetResourceStream() or something.
To expand on the previous answer, text files can be very useful in a number of ways, especially if you have multiple people working on a project. Adding a todo list or instructions to other developers in the project tree itself makes them more obvious.
It also helps to keep them up-to-date when using code revision control.
(Would have commented but not enough reputation... the previous answer sums it up)
I add 'TextFile' in project ,now problem is ,How to access it(Or Open it) on Button click Event.
When showing the open file dialog, I want to show up the "App,lication Links" category in the left side pane on Vista/7. Visual Studio does that too when opening project files.
How can I do this with a standard OpenFileDialog-Object in C#? I am using WPF by the way, but I don't think that matters in this case.
You need to use FileDialog.CustomPlaces. That MSDN link contains some sample code to get you going. Ultimately this is wrapping the native functionality exposed by IFileDialog::AddPlace.
I have an sftp client, and would like to drag virtual files from my listview (actually ObjectListView) to desktop, or other target accepting drop file. I can drag files from desktop to my listview and then upload it.
The file being dropped is not present on the local filesystem, at the time of drag/drop.
I am not too familiar with drag/drop, so if anyone has any resources related to this, please post them.
Most related drag/drop questions doesn't answer my specific question as far as I looked.
Look for my answer to this question: Drag and drop virtual files using IStream. I must say, that task you want to implement is not easy to do, and (from what I know) there is no simple, working solution on the net for this.
But I've implemented such task by myself in .net, so it is possible of course. You can find all necessary details in the link above.
Ok this is something new to me....
I have a gridview control which is displaying the files and directory names in one column.
Now i want to display the file icon of that particular file in the other column...
eg test.txt will have a different icon form image1.jpg and here.xsl
i have found two examples but don't kno if they will work or not....
http://www.codeproject.com/KB/custom-controls/AssociatedIconsImage.aspx
or
http://forums.asp.net/t/90921.aspx
how to incorporate this with my gridview..?
thanks
I found a source that should be useful for you (and with a simple google query btw.): Getting Associated Icons Using C#
.
As far as I know, there's no other way than using the shell32 library via interop, as used in the given example.
I'm not sure if there is a managed way to this... there very well could be, but the unmanaged way to get this would be to use PInvoke to call SHGetFileInfo. There is sample code on PInvoke.Net which should get you most of the way there.
Ok, so this question kind of builds on my last one. I am trying to build a "file browser" but it will do other things.
What I am trying to accomplish:
Have a tab dedicated to listing files just like "Browse Files" except I want to be able
check certain files and directories. I also want the functionality of "Browse Files" as
change location.
Get value's from checkboxes to apply elsewhere.
The question's kinda vague. We really need a basic implementation to build on or we might be giving you bad advice.
That said, here are some links that might help you get started:
SplitContainer control (in the toolbox)
ListView control (in the toolbox)
Get File Icon used by Shell