开发者

Opening folder with no law to escape

开发者 https://www.devze.com 2022-12-20 17:50 出处:网络
how open a folder from winforms in this way that user couldn\'t move from this folder to anot开发者_如何学Cher?

how open a folder from winforms in this way that user couldn't move from this folder to anot开发者_如何学Cher?

He could only remove or add files to this folder.

And he could close this folder and return to his winforms app.


It's not really possible (I assume you mean open it in Explorer). Your best bet is to have him run as a user that only has permissions to open that folder. What I mean is that you should try and solve this using the inbuilt Windows ACL system.

Perhaps if you provide more details we can help solve the underlying issue.


    path = folderBrowserDialog1.SelectedPath;


ImageList imageList1 = new ImageList();
imageList1.ImageSize = new Size(256, 256);
imageList1.ColorDepth = ColorDepth.Depth24Bit;
string[] iconFiles = Directory.GetFiles(path, "*.jpg");

foreach (string iconFile in iconFiles)
{
   try
   {
      imageList1.Images.Add(Image.FromFile(iconFile));
   }
   catch
   {
         MessageBox("Error","");
   }
}

this.listView1.View = View.LargeIcon;
this.listView1.LargeImageList = imageList1;

for (int j = 0; j < imageList1.Images.Count; j++)
{
    ListViewItem item = new ListViewItem();

    item.ImageIndex = j;   
    this.listView1.Items.Add(item);               
}

This displays thumbnails of files. How to stick this with files? Deleting, renaming??

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号