十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
涉及的知识有两大块:
成都创新互联网络公司拥有10多年的成都网站开发建设经验,1000+客户的共同信赖。提供成都做网站、网站设计、网站开发、网站定制、外链、建网站、网站搭建、成都响应式网站建设、网页设计师打造企业风格,提供周到的售前咨询和贴心的售后服务
一,用VB.NET读取数据表数据。
二,使用VB.NET修改文件名。
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
For Each FileName As String In IO.Directory.GetFiles("E:\音乐", "*.mp3")
TextBox1.Text = vbNewLine IO.Path.GetFileName(FileName)
Next
End Sub
VB的我会弄NET的不知道和VB是不是一样、VB中需要用到API函数提取exe图标加载到imagelist和通用控件然后截取文件名、然后用listview加载imagelist的图标和通用控件的文件名
获取方法,参考实例如下:
'获取路径名各部分:
如:
c:\dir1001\aaa.txt
'获取路径路径
c:\dir1001\
Public
Function
GetFileName(FilePathFileName
As
String)
As
String
'获取文件名
aaa.txt
On
Error
Resume
Next
Dim
i
As
Integer,
J
As
Integer
i
Len(FilePathFileName)
J
InStrRev(FilePathFileName,
"\")
GetFileName
Mid(FilePathFileName,
J
+
1,
i)
End
Function
''获取路径路径
c:\dir1001\
Public
Function
GetFilePath(FilePathFileName
As
String)
As
String
'获取路径路径
c:\dir1001\
On
Error
Resume
Next
Dim
J
As
Integer
J
InStrRev(FilePathFileName,
"\")
GetFilePath
Mid(FilePathFileName,
1,
J)
End
Function
'获取文件名但不包括扩展名
aaa
Public
Function
GetFileNameNoExt(FilePathFileName
As
String)
As
String
'获取文件名但不包括扩展名
aaa
On
Error
Resume
Next
Dim
i
As
Integer,
J
As
Integer,
k
As
Integer
i
Len(FilePathFileName)
J
InStrRev(FilePathFileName,
"\")
k
InStrRev(FilePathFileName,
".")
If
k
Then
GetFileNameNoExt
Mid(FilePathFileName,
J
+
1,
i
-
J)
Else
GetFileNameNoExt
Mid(FilePathFileName,
J
+
1,
k
-
J
-
1)
End
If
End
Function
'=====
'获取扩展名
.txt
Public
Function
GetFileExtName(FilePathFileName
As
String)
As
String
'获取扩展名
.txt
On
Error
Resume
Next
Dim
i
As
Integer,
J
As
Integer
i
Len(FilePathFileName)
J
InStrRev(FilePathFileName,
".")
If
J
Then
GetFileExtName
".txt"
Else
GetFileExtName
Mid(FilePathFileName,
J,
i)
End
If
End
Function