I have a drag and drop application (which allows users to organize their files) that takes files. The app keeps a list of strings that corresponds to the files, but i开发者_如何学运维t does not need access to the files themselves. The problem is that the program locks files like the application has them open. How can I release them?
private void File_Dropped(object sender, DragEventArgs e)
{
    if (!e.Data.GetDataPresent(DataFormats.FileDrop))
        return;
    var files = e.Data.GetData(DataFormats.FileDrop, true) as string[];
    ImageFile iFile;
    foreach (var file in files)
    {
        if (_Extensions.Contains(IO.Path.GetExtension(file).ToUpper()))
        {
            iFile = new ExtendedImageFile(new StringBuilder(file).ToString());
            LBXFiles.Items.Add(iFile);
        }
    }
    e.Handled = true;
}
Fantastic fix lived up to his name. See the commend on the original post
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论