GetFile to save to other DIR

Discussion in 'Questions (Windows Mobile)' started by tcgoh, Aug 4, 2008.

  1. tcgoh

    tcgoh Active Member Licensed User

    Hi all,

    Can anyone help me to write a code to select a file in the Dir(eg. textall.dat) and safe it to another Dir?

    I tried SaveDialog but the filename field is emty. I wanted filename field to be fill up w/o letting the user select.

    Thanks
    TC
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Can you give an example of what you are trying to achieve?
     
  3. specci48

    specci48 Well-Known Member Licensed User

    To preselect a filename in the savedialog you have to define the file property of the savedialog before showing it, e.g.:
    Code:
    SaveDialog1.File = AppPath & "\test.txt"
       SaveDialog1.Show
    specci48


    Edit: added a very simple copy sample...
     

    Attached Files:

    Last edited: Aug 4, 2008
  4. tcgoh

    tcgoh Active Member Licensed User

     
  5. Cableguy

    Cableguy Expert Licensed User

    Why not read the file to end and write the file again in the new dir, this way the user is not prompt in any way...
     
  6. specci48

    specci48 Well-Known Member Licensed User

    Just use filecopy
     
  7. tcgoh

    tcgoh Active Member Licensed User

    Actually its a SQL file(sl3). Its about 2mb, haven't try yet, not sure it will work? will it?

    Thanks
     
  8. tcgoh

    tcgoh Active Member Licensed User

    Hi All,

    Thanks for all that help here. I Have manage to pre-select the file to safe into another directory. (its a NO GO to read sl3 file and filewrite again)

    However, appreciate if anyone can help to shortern the steps required to safe the selected file without having to show the openDialog.

    Thanks.
     
  9. Cableguy

    Cableguy Expert Licensed User

    Posting the Actual code would help us Help you...How can we shorten the steps if we do not know the way you took?
     
    Last edited: Aug 8, 2008
  10. tcgoh

    tcgoh Active Member Licensed User

    Thanks Cableguy, problem solved. Here the code

    opendialog1.File = AppPath & "\alldata.sl3"
    openDialog1.Filter = "sl3 DATA Files|*.sl3"

    SaveDialog1.File = OpenDialog1.File

    If SaveDialog1.Show = cCancel Then
    Return
    End If


    FileCopy(OpenDialog1.File, SaveDialog1.File)

    Thanks Again
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice