当前位置: 代码迷 >> VB Dotnet >> 冒泡!vb.net 搜索文件找出所在目录的有关问题
  详细解决方案

冒泡!vb.net 搜索文件找出所在目录的有关问题

热度:123   发布时间:2016-04-25 02:19:25.0
冒泡!vb.net 搜索文件找出所在目录的问题

最近手痒了,又开始想写个小工具,不过发现不会弄呀。呵

假定已经知道文件 test.exe 我需要根据文件名查找出这所在的目录,然后更改目录名称。
vb.net 2010 ...
各位大佬指点。
------解决方案--------------------
这个是显示目录:MsgBox("Application directory path: " & My.Application.Info.DirectoryPath)
至于更改目录,我觉得有难度。因为这个软件就在目录里面运行
------解决方案--------------------
   For Each filename As String In IO.Directory.GetFiles("d:\data", "test.exe", IO.SearchOption.AllDirectories)
            Dim file As IO.FileInfo = New IO.FileInfo(filename)
            Rename(file.DirectoryName, "d:\t")
        Next
  相关解决方案