module1.bas

来自「此程序为网络电视」· BAS 代码 · 共 39 行

BAS
39
字号
Attribute VB_Name = "Module1"
Public Function GetFileName(strURL As String) As String
On Error Resume Next
    Dim i As Integer
    Dim strFileName As String
    
    i = Len(strURL) - 1
    
    If i <= 0 Then GetFileName = "": Exit Function
    If Mid(strURL, 1, 7) <> "http://" Then GetFileName = "": Exit Function
    If strURL = "http://" Then GetFileName = "": Exit Function
    
    Do Until i = 0
        If Mid(strURL, i, 1) = "/" Then
            strFileName = Mid(strURL, i + 1, Len(strURL) - i)
            
            Dim a As Integer
            
            a = Len(strFileName) - 1
            
            Do Until a = 0
                If Mid(strFileName, a, 1) = "." Then
                    GetFileName = strFileName
                    Exit Function
                Else
                    a = a - 1
                End If
            Loop
            
            Exit Do
        Else
            i = i - 1
        End If
    Loop
    
    GetFileName = ""
End Function

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?