TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Eric Hamilton
NA
14
0
Damn listview
Dec 15 2009 3:35 AM
I got a code:
using
System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Linq;
using
System.Text;
using
System.Windows.Forms;
using
System.IO;
using
System.Management;
namespace
WindowsFormsApplication1
{
public
partial
class
Form1
:
Form
{
public
Form1()
{
InitializeComponent();
}
private
void
treeView1_AfterSelect(
object
sender,
TreeViewEventArgs
e)
{
e.Node.Nodes.Clear();
string
[] dir =
Directory
.GetDirectories(e.Node.FullPath, (
"*"
));
for
(
int
i = 0; i < dir.Length; i++)
{
DirectoryInfo
mappeninfo =
new
DirectoryInfo
(dir[i]);
e.Node.Nodes.Add(mappeninfo.Name);
}
}
private
void
Form1_Load(
object
sender,
EventArgs
e)
{
string
[] directories =
Directory
.GetLogicalDrives();
// hier word de directories geladen
foreach
(
string
s
in
Directory
.GetLogicalDrives())
{
treeView1.Nodes.Add(s);
}
}
private
void
listView1_SelectedIndexChanged(
object
sender,
EventArgs
e)
{
string
sPath = (
"*"
);
DirectoryInfo
di =
new
DirectoryInfo
(sPath);
FileInfo
[] rgFiles = di.GetFiles(
"*"
);
}
}
}
but the listview wont show any files in any directory
Reply
Answers (
6
)
WPF C# web app textbox to search a richtextbox
Printing rows from database Visual C#