明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1764|回复: 3

怎样选择文件返回文件路径(求助)

[复制链接]
发表于 2011-10-6 16:21:38 | 显示全部楼层 |阅读模式
本帖最后由 qcw911 于 2011-10-6 16:29 编辑

通过对话框选择某路径下的文件(*.xls or *.txt or *csv.)
返回值为该文件所在路径

通过对话框选择MyFolde下的 MyFile.txt文件
返回值 "C:\\MyFolder\\MyFile.txt"

各位高手帮帮忙

类似这个
(defun Get_Folder( / path_object shell)
(setq shell (Vlax-Get-Or-Create-Object "Shell.Application" ))
(if (setq path_object (vlax-invoke shell 'BrowseForFolder 0 "" 0 0))
  (vlax-get (vlax-get path_object 'Self) 'Path)
)
)
但是这个是选择文件夹,返回文件夹路径
"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2011-10-6 16:55:39 | 显示全部楼层
(dos_getfiled title path filter)
需DosLib支持
发表于 2011-10-6 17:14:43 | 显示全部楼层
(getfiled "选择*文件" "c:" "" 8)
 楼主| 发表于 2011-10-7 13:18:54 | 显示全部楼层
duotu007 发表于 2011-10-6 17:14
(getfiled "选择*文件" "c:" "" 8)

3Q
非常給力!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-7-25 04:53 , Processed in 0.144851 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表