openfiledialog control locks folder

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • juststarter

    #1

    openfiledialog control locks folder

    Hello all,
    I am using an openFileDialog box to select a file (in order to insert it in
    a database). When the file is selected i am filling a few textboxes with the
    actual path, filename and extension of the file, so i no longer need the
    openfiledialog, thus i am using openfiledialog1 .reset() method to reset it.
    (i have also tried openfiledialog. dispose() with no results)
    The problem i am encountering is that the folder in which the selected file
    resides is somehow locked by the application and i can not rename/copy/etc if
    i do not close the application (or reopen the openFileDialog to select
    another folder).
    Is there a way to release the lock on the folder without closing the app ?
    Thx in advance
    theodore

  • Cor Ligthert

    #2
    Re: openfiledialog control locks folder

    Theodore,

    That is most unlikely what you tell, I never saw this in these dotNet
    newsgroups. Are you sure you have all files closed after using?

    Cor


    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: openfiledialog control locks folder

      "juststarte r" <juststarter@di scussions.micro soft.com> schrieb:[color=blue]
      > I am using an openFileDialog box to select a file (in order to insert it
      > in
      > a database). When the file is selected i am filling a few textboxes with
      > the
      > actual path, filename and extension of the file, so i no longer need the
      > openfiledialog, thus i am using openfiledialog1 .reset() method to reset
      > it.
      > (i have also tried openfiledialog. dispose() with no results)
      > The problem i am encountering is that the folder in which the selected
      > file
      > resides is somehow locked by the application and i can not rename/copy/etc
      > if
      > i do not close the application (or reopen the openFileDialog to select
      > another folder).[/color]

      I am able to reproduce this behavior using .NET 1.1 SP1, Windows XP
      Professional SP2. Setting the file dialog's 'RestoreDirecto ry' property to
      'True' seems to fix the problem.

      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://classicvb.org/petition/>

      Comment

      • Cor Ligthert

        #4
        Re: openfiledialog control locks folder

        Herfried,

        Than I saw it now for the first time.
        (And remember that of course)


        :-)

        Cor


        Comment

        Working...