广州linux

当前位置:   网站首页 >> 未命名

声卡一键切换 2块声卡快速切换 快速切换声卡源码

有2块声卡,每次都要手动去切换,今天觉得麻烦,写了一下,代码可能有些臃肿,欢迎回复说明。没有技术含量,勿喷。(vb源码)
'------------------------------------------------------------------------------
'@summary   程序入口
'------------------------------------------------------------------------------
Public Sub Main()
Dim lineE As Boolean
Open App.Path & "\sj.dat" For Append As #1
Close
sk (False)
sk (True)
Open App.Path & "\sj.dat" For Input As #1
Do While Not EOF(1)
Input #1, lineEe
Loop
Close
lineE = lineEe
Shell "CMD.exe /c " & App.Path & "\" & lineE & ".vbs", vbHide
Open App.Path & "\sj.dat" For Output As #1
Print #1, (Not lineE)
Close
End Sub



Sub sk(intT As Boolean)
Open App.Path & "\" & intT & ".vbs" For Output As #1
Print #1, "Dim WshShell"
Print #1, "Set WshShell = CreateObject(""WScript.Shell"")"
Print #1, "WshShell.Run (""rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,0"")"
Print #1, "WScript.Sleep(500)"
Print #1, "WshShell.SendKeys(""{DOWN}"")"
If intT Then Print #1, "WshShell.SendKeys(""{DOWN}"")"
Print #1, "WScript.Sleep(100)"
Print #1, "WshShell.SendKeys(""%+S"")"
Print #1, "WScript.Sleep(100)"
Print #1, "WshShell.SendKeys(""{ENTER}"")"
Close
End Sub

发表我的评论

Hi,您需要填写昵称和邮箱!

  • 必填项