7 个解决方案
#1
Syntax
GetFileSaveName ( title, pathname, rfilename {, extension {, filter } } )
Argument Description
title A string whose value is the title of the dialog box
pathname A string variable whose value is the default filename and which will store the returned path and filename. The default filename is displayed in the File name box, but the user can specify another name
rfilename A string variable in which you want to store the returned filename
extension (optional) A string whose value is a 1- to 3-character default file extension. The default is no extension
filter (optional) A string whose value is the description of the displayed files and the file extension that you want use to select the displayed files (the filter). The format for filter is:description,*. extThe default is:"All Files (*.*),*.*"
Return value
Integer. Returns 1 if it succeeds, 0 if the user clicks the Cancel
E:
string docname, named
//在此将路径和名称指定即可
docname = "c:\"
named = "save.txt"
integer value
value = GetFileSaveName("Select File", &
docname, named, "DOC", &
"Text Files (*.TXT),*.TXT," + &
" Doc Files (*.DOC), *.DOC")
IF value = 1 THEN ...
GetFileSaveName ( title, pathname, rfilename {, extension {, filter } } )
Argument Description
title A string whose value is the title of the dialog box
pathname A string variable whose value is the default filename and which will store the returned path and filename. The default filename is displayed in the File name box, but the user can specify another name
rfilename A string variable in which you want to store the returned filename
extension (optional) A string whose value is a 1- to 3-character default file extension. The default is no extension
filter (optional) A string whose value is the description of the displayed files and the file extension that you want use to select the displayed files (the filter). The format for filter is:description,*. extThe default is:"All Files (*.*),*.*"
Return value
Integer. Returns 1 if it succeeds, 0 if the user clicks the Cancel
E:
string docname, named
//在此将路径和名称指定即可
docname = "c:\"
named = "save.txt"
integer value
value = GetFileSaveName("Select File", &
docname, named, "DOC", &
"Text Files (*.TXT),*.TXT," + &
" Doc Files (*.DOC), *.DOC")
IF value = 1 THEN ...
#2
可以,如下:
string st_chu_path='12345.dbf',st_chu_name
GetFileSaveName ("保存文件",st_chu_path,st_chu_name,"dbf","dbf 文件(*.dbf),*.dbf,文本文件(*.txt),*.txt,Excel文件(*.xls),*.xls,JPG文件(*.JPG;*.jpeg;*.jpe),*.JPG;*.jpeg;*.jpe,所有文件 (*.*), *.*")
string st_chu_path='12345.dbf',st_chu_name
GetFileSaveName ("保存文件",st_chu_path,st_chu_name,"dbf","dbf 文件(*.dbf),*.dbf,文本文件(*.txt),*.txt,Excel文件(*.xls),*.xls,JPG文件(*.JPG;*.jpeg;*.jpe),*.JPG;*.jpeg;*.jpe,所有文件 (*.*), *.*")
#3
呵呵.....看看下列代码吧,我测试过了,没有问题,默认文件名为:未命名
String ls_File, ls_Path, ls_Ext,ls_filename
ls_filename="未命名"
GetFileSaveName("另存为",ls_filename,ls_Path, "Excel", "Excel Files (*.xls),*.xls," + "Text Files (*.txt),*.txt,HTML Files (*.htm),*.htm")
If Trim(ls_Path) <> "" Then
ls_Ext = Lower(Right(ls_Path, 3))
Choose Case ls_Ext
Case "xls"
dw_master.SaveAs(ls_Path, Excel!,True)
Case "txt"
dw_master.SaveAs(ls_Path, Text!, True)
Case "htm"
dw_master.SaveAs(ls_Path, HTMLTable!, True)
Case Else
MessageBox("另存为...", "另存格式错误.格式应该" + & "是*.xls'为Excel!;'*.txt'为Text;'*.htm'为HTML Table", Exclamation!, OK!)
Return
End Choose
End if
String ls_File, ls_Path, ls_Ext,ls_filename
ls_filename="未命名"
GetFileSaveName("另存为",ls_filename,ls_Path, "Excel", "Excel Files (*.xls),*.xls," + "Text Files (*.txt),*.txt,HTML Files (*.htm),*.htm")
If Trim(ls_Path) <> "" Then
ls_Ext = Lower(Right(ls_Path, 3))
Choose Case ls_Ext
Case "xls"
dw_master.SaveAs(ls_Path, Excel!,True)
Case "txt"
dw_master.SaveAs(ls_Path, Text!, True)
Case "htm"
dw_master.SaveAs(ls_Path, HTMLTable!, True)
Case Else
MessageBox("另存为...", "另存格式错误.格式应该" + & "是*.xls'为Excel!;'*.txt'为Text;'*.htm'为HTML Table", Exclamation!, OK!)
Return
End Choose
End if
#4
试试
#5
语法:
GetFileSaveName ( title, pathname, rfilename {, extension {, filter } } )
把第三个参数改成你的文件名即可!
GetFileSaveName ( title, pathname, rfilename {, extension {, filter } } )
把第三个参数改成你的文件名即可!
#6
首先将数据库中的数据导成Txt文本,然后,等数据库升级后,将这些文本数据导入即可。
如果发生错误,最好的办法就是重新导入。
如果发生错误,最好的办法就是重新导入。
#7
这个函数 似乎有个小毛病
就是如果在对话框出现后点击已经存在的文件
它不会提示你‘是否覆盖’的友好性提示
(想想还是VC和BORLAND的产品好,PB做的好多东西太不细致了)
就是如果在对话框出现后点击已经存在的文件
它不会提示你‘是否覆盖’的友好性提示
(想想还是VC和BORLAND的产品好,PB做的好多东西太不细致了)
#1
Syntax
GetFileSaveName ( title, pathname, rfilename {, extension {, filter } } )
Argument Description
title A string whose value is the title of the dialog box
pathname A string variable whose value is the default filename and which will store the returned path and filename. The default filename is displayed in the File name box, but the user can specify another name
rfilename A string variable in which you want to store the returned filename
extension (optional) A string whose value is a 1- to 3-character default file extension. The default is no extension
filter (optional) A string whose value is the description of the displayed files and the file extension that you want use to select the displayed files (the filter). The format for filter is:description,*. extThe default is:"All Files (*.*),*.*"
Return value
Integer. Returns 1 if it succeeds, 0 if the user clicks the Cancel
E:
string docname, named
//在此将路径和名称指定即可
docname = "c:\"
named = "save.txt"
integer value
value = GetFileSaveName("Select File", &
docname, named, "DOC", &
"Text Files (*.TXT),*.TXT," + &
" Doc Files (*.DOC), *.DOC")
IF value = 1 THEN ...
GetFileSaveName ( title, pathname, rfilename {, extension {, filter } } )
Argument Description
title A string whose value is the title of the dialog box
pathname A string variable whose value is the default filename and which will store the returned path and filename. The default filename is displayed in the File name box, but the user can specify another name
rfilename A string variable in which you want to store the returned filename
extension (optional) A string whose value is a 1- to 3-character default file extension. The default is no extension
filter (optional) A string whose value is the description of the displayed files and the file extension that you want use to select the displayed files (the filter). The format for filter is:description,*. extThe default is:"All Files (*.*),*.*"
Return value
Integer. Returns 1 if it succeeds, 0 if the user clicks the Cancel
E:
string docname, named
//在此将路径和名称指定即可
docname = "c:\"
named = "save.txt"
integer value
value = GetFileSaveName("Select File", &
docname, named, "DOC", &
"Text Files (*.TXT),*.TXT," + &
" Doc Files (*.DOC), *.DOC")
IF value = 1 THEN ...
#2
可以,如下:
string st_chu_path='12345.dbf',st_chu_name
GetFileSaveName ("保存文件",st_chu_path,st_chu_name,"dbf","dbf 文件(*.dbf),*.dbf,文本文件(*.txt),*.txt,Excel文件(*.xls),*.xls,JPG文件(*.JPG;*.jpeg;*.jpe),*.JPG;*.jpeg;*.jpe,所有文件 (*.*), *.*")
string st_chu_path='12345.dbf',st_chu_name
GetFileSaveName ("保存文件",st_chu_path,st_chu_name,"dbf","dbf 文件(*.dbf),*.dbf,文本文件(*.txt),*.txt,Excel文件(*.xls),*.xls,JPG文件(*.JPG;*.jpeg;*.jpe),*.JPG;*.jpeg;*.jpe,所有文件 (*.*), *.*")
#3
呵呵.....看看下列代码吧,我测试过了,没有问题,默认文件名为:未命名
String ls_File, ls_Path, ls_Ext,ls_filename
ls_filename="未命名"
GetFileSaveName("另存为",ls_filename,ls_Path, "Excel", "Excel Files (*.xls),*.xls," + "Text Files (*.txt),*.txt,HTML Files (*.htm),*.htm")
If Trim(ls_Path) <> "" Then
ls_Ext = Lower(Right(ls_Path, 3))
Choose Case ls_Ext
Case "xls"
dw_master.SaveAs(ls_Path, Excel!,True)
Case "txt"
dw_master.SaveAs(ls_Path, Text!, True)
Case "htm"
dw_master.SaveAs(ls_Path, HTMLTable!, True)
Case Else
MessageBox("另存为...", "另存格式错误.格式应该" + & "是*.xls'为Excel!;'*.txt'为Text;'*.htm'为HTML Table", Exclamation!, OK!)
Return
End Choose
End if
String ls_File, ls_Path, ls_Ext,ls_filename
ls_filename="未命名"
GetFileSaveName("另存为",ls_filename,ls_Path, "Excel", "Excel Files (*.xls),*.xls," + "Text Files (*.txt),*.txt,HTML Files (*.htm),*.htm")
If Trim(ls_Path) <> "" Then
ls_Ext = Lower(Right(ls_Path, 3))
Choose Case ls_Ext
Case "xls"
dw_master.SaveAs(ls_Path, Excel!,True)
Case "txt"
dw_master.SaveAs(ls_Path, Text!, True)
Case "htm"
dw_master.SaveAs(ls_Path, HTMLTable!, True)
Case Else
MessageBox("另存为...", "另存格式错误.格式应该" + & "是*.xls'为Excel!;'*.txt'为Text;'*.htm'为HTML Table", Exclamation!, OK!)
Return
End Choose
End if
#4
试试
#5
语法:
GetFileSaveName ( title, pathname, rfilename {, extension {, filter } } )
把第三个参数改成你的文件名即可!
GetFileSaveName ( title, pathname, rfilename {, extension {, filter } } )
把第三个参数改成你的文件名即可!
#6
首先将数据库中的数据导成Txt文本,然后,等数据库升级后,将这些文本数据导入即可。
如果发生错误,最好的办法就是重新导入。
如果发生错误,最好的办法就是重新导入。
#7
这个函数 似乎有个小毛病
就是如果在对话框出现后点击已经存在的文件
它不会提示你‘是否覆盖’的友好性提示
(想想还是VC和BORLAND的产品好,PB做的好多东西太不细致了)
就是如果在对话框出现后点击已经存在的文件
它不会提示你‘是否覆盖’的友好性提示
(想想还是VC和BORLAND的产品好,PB做的好多东西太不细致了)