html怎么嵌套vbs文件夹,HTML_vbs选择文件夹效果代码,不用组件的话有两种办法: se - phpStudy...

vbs选择文件夹效果代码

不用组件的话有两种办法:

set objFile = CreateObject("SAFRCFileDlg.FileOpen")

Set objShell = CreateObject("Shell.Application")

本blog里都有示例。

如果调用vb组件,可以是:

flag = &h200

whichone = OpenFile("Choose a File!", "C:\", "Everything|*.*|TextFiles|*.TXT|Word-Documents|*.DOC", 2, flag)

MsgBox "Raw data returned: " & whichone

' Split up multi selection result:

' space is used as separator:

whichone = Split(whichone, " ")

' field index 0 contains path information:

path = whichone(0)

' list all the files:

' how many files were selected?

filecount = UBound(whichone)

if filecount=0 then

' just one file selected!

MsgBox "You selected one file: " & whichone(0)

' check status of Read Only checkbox

' is bit 1 set or cleared?

' works only if just one file was selected!

MsgBox "Returned flag: " & flag

if (flag and 1) then

' (flag and 1)<>0, transforms to true

' bit is set!

MsgBox "ReadOnly selected!"

else

MsgBox "ReadOnly not selected!"

end If

' check whether selected file is of default type (txt)

if (flag and 1024) then

MsgBox "selected file is no txt file!"

else

MsgBox "selected file is of default type!"

end if

else

' more than one file selected!

MsgBox "You selected " & filecount & " files!"

for x = 1 to UBound(whichone)

list = list & path & whichone(x) & vbCr

next

MsgBox list

end If

function OpenFile(title, dir, filter, index, flags)

set comdlg = CreateObject("MSComDlg.CommonDialog")

comdlg.filter = filter

comdlg.FilterIndex = index

comdlg.Flags = flags

comdlg.MaxFileSize = 260

comdlg.CancelError = false

comdlg.DialogTitle = title

comdlg.InitDir = dir

' set txt as default

comdlg.DefaultExt = "txt"

comdlg.ShowOpen

OpenFile = comdlg.filename

' important: return flag status so your main script can

' check it:

flags = comdlg.Flags

end function

组件相关文件下载 http://xiazai.phpstudy.net/jbtools/vb6controls.rar相关阅读:

Win2003 64位Web服务器安装配置注意事项

css3阴影属性box-shadow注意事项

javascript getElementById 使用方法及用法

javascript版的日期输入控件(5)

ASP常用的系统配置函数

比较简单实用的使用正则三种版本的js去空格处理方法

实现 win2003 下 mysql 数据库每天自动备份

HTML表格标记教程(17):表格标题垂直对齐属性VALIGN

Windows Server 2008:服务器与域分离

没有form表单情况下敲回车键提交表单的js代码

一句话JavaScript表单验证代码

Access 2007 创建和使用附件字段

phpBB 3.0.6 RC1简单介绍和下载

让批处理被wsh解析的代码

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值