用哪个语句或函数可以得到文件的扩展名呢,比如 *.ini *.doc *.txt *.mdb…………
希望给举出示例
希望给举出示例
解决方案 »
- Round(VAL("682.088"),-2)这样写怎么有误
- VB如何运行TXT里面的内容?
- 不用WebBrowser完整的一次访问网站怎么做?
- 谁能拖动无标题样的椭圆形的EXCEL工作表?(
- 史上最强!超级矢量图形开发控件!VB开发示例!
- 下载的水晶报表.iso如何使用?
- 局网内的文件拷贝?????盼
- 如何做出象vb打开对话框一样的窗体
- 如保读取串口条形码扫描议扫描的信息?
- how to capture the unload event of form,I want to provent user to close current window and alarm him there is some other things
- 用VB开发的几个模块外包!!!!!
- vb activex控件web分发安全性问题?在线等!
dim iPos as integer
ipos=instrrev(strfile,".")
if ipos<=0 then exit function
getfileext=mid(strfile,ipos+1,len(strfile)-ipos)
end function
Dim strExName As String
Dim strFileName As String
Dim lngDot As Long
strFileName = "c:\myfile.doc"
lngDot = InStrRev(strFileName, ".")
If lngDot > 0 Then
strExName = Right(strFileName, Len(strFileName) - lngDot + 1)
MsgBox strExName
End If
End Sub
再用InStrRev查找最右边的“.”
再用Right取得扩展名