我使用以下.net代码注册url:
Dim SysInfo As System.Security.Principal.WindowsIdentity = System.Security.Principal.WindowsIdentity.GetCurrent()
Dim txt As String = "netsh http add urlacl http://+:6768/ user=" & SysInfo.Name
File.WriteAllText(My.Computer.FileSystem.SpecialDirectories.Desktop & "\regwcf.bat", txt)我在提升/管理模式下运行bat文件,它注册。通常,这在大多数Windows系统中都很好,但是在Windows 11中,它给出的错误为87,参数不正确。
对于我的pc,这是输出: netsh http add urlacl http://+:6768/ User =ADMIN-膝上型计算机\Test User
怎么了?
发布于 2022-05-09 05:23:20
Dim txt = String.Format("netsh http add urlacl http://+:6768/ user=""{0}""", SysInfo.Name)以上代码解决了这个问题。
https://stackoverflow.com/questions/72166958
复制相似问题