ҡդӶ ʵŧ 纺촨շ٨絴͵ ᷹ФѺ

͵Դҷҧ Inbox Ѻ

˹ѡ
-
VB 6/VB.Net
ASP/ASP.Net
Ѻ¤
¹ҹ Flash Movie
ռͺش  
 RSS Feeds
 ǹŴ RSS Reader ...   Download  RSS Reader

Forum - www.g2gnet.com
Webmaster - www.g2gnet.com
Visitors - Session views
 5 6 1 6 0 9 4

7 ѹҤ ..2549
48 Users On-Line.
Visitors - Page views
 8 9 7 3 8 3 7
1 Ҿѹ ..2551

Google   
g2gnet.com
Ҵѡ:  

¹ 繵ѡõ硷

Category »  VB 6/VB.Net
: Webmaster 5/11/2549 12:49:00
(ҹ : 19024) 

ҳԧ ѧª͹ѹҹ֧价ѹԾ 촴ʵ¹ º§ ҧҧҴ
: " ͧǹ촴ʵѹѧǨѧ"
ҧ : " ... ʹٷҤҢͧѹ"
: ... ͵Ҷ (Դ ... ѹࢡšͧ)

Ѩغѹ෤շ Ϳ 件֧˹ѹ ͧѧͺʵҳҧ Norton Utilities Version 3 ͹ ҹ֧ǫ¨ Ǩͺ촴ʵ WinXp 红 ( ٵҡ Windows 98) ҡҪ ʡ ҧ (ҡ) 繵˭ (Upper Case) ѹ ѹѹͧµҾԡ 稹ѭ (Ẻԧ) Ҥ ÷ѹŧѺ繵͹ Ӥҭµҵͧԧ

ҡй͵¹ Ъ Դ Visual Basic ǡҡ Common Control 鹰ҹ 4 ѹ Сͺ

  • DriveListBox - Drive1
  • DirListBox - Dir1
  • FileListBox - File1
  • CommandButton ա 3 繻¹ Folder л¹ 繵 ÷ӧҹ (ѹҷ ... ͧ)

    Ẻ͡Ẻ͹ҧѵ ͡¡ҹФѺ ͵ͧ͡ Folder ͧҡ͹ǡ Loop ҷء ( ͡§ǡ) ¹ѹҤѺ

     

    ͡Ẻ
    ͡Ẻʴ

    觷ӧҹ
    ٪ ʡѹبҴµҫԹ

    觷ӧҹ
    ͡͹ ͵ͧ¹§ ҡ͡ʴҵͧ¹

    ǹŴ Source Code - Visual Basic (SP6) ǹŴ - Execute

    ... ҡҹ Run سҴǹŴ Visual Basic 6.0 SP5: Run-Time Redistribution Pack ҵԴ駡͹ФѺ

    ͧҴ ѹѺ
    Option Explicit

    Private Sub cmdExit_Click()
        End
    End Sub

    Private Sub cmdUpdateFile_Click()
        If File1.ListCount > 0 And File1.ListIndex < 0 Then  ' ͺª Ǩͺաá͡ FileListBox 蹤͵ͧ¹ͷ
            Call ChangeFile2Lower(Dir1.Path)  ' ·¹ 觤ҵ˹觻Ѩغѹ仴
        ElseIf Len(Trim(File1.FileName)) <> 0 Then
            Call ChangeSingleFile2Lower(Dir1.Path, File1.FileName)  ' ·¹ 觤ҵ˹觻Ѩغѹ ͧ仴
        End If

        File1.FileName = Dir1.List(Dir1.ListIndex)
        File1.Refresh
    End Sub

    Private Sub cmdUpdateFolder_Click()
        Call ChangeFolder2Lower (Dir1.Path)  ' ·¹ 觤ҵ˹觻Ѩغѹ仴
        Dir1.Path = Dir1.List(Dir1.ListIndex - 1)
        Dir1.Refresh
    End Sub

    Private Sub Dir1_Change()
        File1.FileName = Dir1.List(Dir1.ListIndex)
        txtPath.Text = Dir1.List(Dir1.ListIndex)
    End Sub

    Private Sub Drive1_Change()
        Dir1.Path = Drive1.Drive
        File1.FileName = Dir1.List(Dir1.ListIndex)
    End Sub

    Private Sub Form_Load()
        txtPath.Text = Dir1.Path
        File1.FileName = Dir1.List(Dir1.ListIndex)
        lblFile(1).Caption = "͡ ͧ¹§ "
    End Sub

    Sub ChangeFolder2Lower(FolderSpec)
        Dim OldFolder$, NewFolder$
        OldFolder = FolderSpec  '
        NewFolder = LCase(FolderSpec)  ' ¿ѧ Lower Case ŧѡ繵
        Name OldFolder As NewFolder
    End Sub

    Sub ChangeSingleFile2Lower(FolderSpec, fName)  ' Ѻҵ˹
        Dim OldFileName$, NewFileName$
        OldFileName = FolderSpec & "\" & fName
        NewFileName = FolderSpec & "\" & LCase(fName)
        Name OldFileName As NewFileName
    End Sub

    Sub ChangeFile2Lower(FolderSpec)
        Dim fs, f, f1, fc
        Dim OldFileName$, NewFileName$
        Set fs = CreateObject("Scripting.FileSystemObject")
        Set f = fs.GetFolder(FolderSpec)
        Set fc = f.Files
        For Each f1 In fc  ' ӧҹ Ҩª
            OldFileName = FolderSpec & "\" & f1.Name  '
            NewFileName = FolderSpec & "\" & LCase(f1.Name)  ' ¿ѧ Lower Case ŧѡ繵
            Name OldFileName As NewFileName  ' Name ¹繪
        Next
    End Sub

    䧤Ѻ (Ш͡ ... ׹ٶ١з觧ҹͧ ѧҤҨҪ蹪ҹͧ) ҧջª͹ѹ ҡҹԸա÷ѹ¡ҹ ô·ʹ ͡ ѹ¹ФѺ 级§Ӿѧ¤Ѻ


  • ͵ - g2gNet Dot Com
    Ţ¹ҳԪ硷͹ԡ 0407314800231
    CopyLeft © 2004 - 2099 g2gNet.Com All rights reserved.
    Email: [email protected] . 08-6862-6560