Imports Microsoft.Win32
Module RegistrySettings
Sub Main()
Dim exePath As String = "C:\Program Files (x86)\阿明音乐\阿明音乐.EXE"
SetFileAssociation(".MP3", "阿明音乐", exePath)
Console.WriteLine("请重启计算机以应用更改。")
End Sub
Sub SetFileAssociation(fileExtension As String, progId As String, exePath As String)
Using key As RegistryKey = Registry.ClassesRoot.CreateSubKey(fileExtension)
key.SetValue(Nothing, progId)
End Using
Using key As RegistryKey = Registry.ClassesRoot.CreateSubKey(progId)
key.SetValue(Nothing, "阿明音乐")
End Using
Using key As RegistryKey = Registry.ClassesRoot.CreateSubKey(progId & "\shell\open\command")
key.SetValue(Nothing, Chr(34) & exePath & Chr(34) & " "%1"")
End Using
End Sub
End Module
网上找
上面代码如何改为狐表?红字代码是什么意思,没看懂?
[此贴子已经被作者于2024/11/1 12:52:46编辑过]