命令行 – 为什么Windows命令shell告诉我使用不同的命令然后说该
关于我的掌上电脑>服务器应用程序使用此处讨论的Web API RESTful方法问题(
Does an ASP.NET Web API app need to be installed into the “real” IIS before a handheld device can access its RESTful methods?),我试图通过使用此处描述的shell命令验证我没有防火墙问题:
http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx,显式:
netsh firewall add portopening TCP 80 IISExpressWeb enable ALL 我也使用端口777做到了,因为那是我在applicationhost.config中设置的那个: <bindings> <binding protocol="http" bindingInformation="*:28642:localhost" /> <binding protocol="http" bindingInformation="*:777:192.168.125.50" /> <binding protocol="https" bindingInformation="*:44300:localhost" /> </bindings> 这样做,我从命令shell得到了这个指纹: 重要说明:命令执行成功.但是,“netsh firewall”已被弃用;请改用“netsh advfirewall firewall”. 所以,我接着输入以下内容(传统/默认端口80,如Hanselmann的帖子所示,然后是我在传统失败时添加到applicationconfig.host的那个(777)),一个接一个: netsh advfirewall firewall add portopening TCP 80 IISExpressWeb enable ALL netsh advfirewall firewall add portopening TCP 777 IISExpressWeb enable ALL 但是,在输入命令shell的命令(或建议)之后,我从cmd shell获得了以下反馈(两次): 找不到以下命令:advfirewall firewall add portopening TCP 80 IISExpressWeb启用ALL. 所以它告诉我使用newfangled命令,然后说没有这样的东西!这个故事是什么?有没有办法实际使用新命令?我的语法错了,还是…… ??? 解决方法
打字netsh /?在命令提示符下解释可用的选项,并查看有关您要键入netsh< option>的选项的信息. / ?.这样做
I:&;netsh advfirewall /? The following commands are available: Commands in this context: ? - Displays a list of commands. consec - Changes to the `netsh advfirewall consec' context. dump - Displays a configuration script. export - Exports the current policy to a file. firewall - Changes to the `netsh advfirewall firewall' context. help - Displays a list of commands. import - Imports a policy file into the current policy store. mainmode - Changes to the `netsh advfirewall mainmode' context. monitor - Changes to the `netsh advfirewall monitor' context. reset - Resets the policy to the default out-of-box policy. set - Sets the per-profile or global settings. show - Displays profile or global properties. The following sub-contexts are available: consec firewall mainmode monitor To view help for a command,type the command,followed by a space,and then type ?. 您可以应用< command> /?更深层次的,比如netsh advfirewall firewall /?,这导致’netsh advfirewall防火墙添加/?`,这导致 I:&;netsh advfirewall firewall add rule /? Usage: add rule name=<string> dir=in|out action=allow|block|bypass [program=<program path>] [service=<service short name>|any] [description=<string>] [enable=yes|no (default=yes)] [profile=public|private|domain|any[,...]] [localip=any|<IPv4 address>|<IPv6 address>|<subnet>|<range>|<list>] [remoteip=any|localsubnet|dns|dhcp|wins|defaultgateway| <IPv4 address>|<IPv6 address>|<subnet>|<range>|<list>] [localport=0-65535|<port range>[,...]|RPC|RPC-EPMap|IPHTTPS|any (default=a ny)] [remoteport=0-65535|<port range>[,...]|any (default=any)] [protocol=0-255|icmpv4|icmpv6|icmpv4:type,code|icmpv6:type,code| tcp|udp|any (default=any)] [interfacetype=wireless|lan|ras|any] [rmtcomputergrp=<SDDL string>] [rmtusrgrp=<SDDL string>] [edge=yes|deferapp|deferuser|no (default=no)] [security=authenticate|authenc|authdynenc|authnoencap|notrequired (default=notrequired)] Remarks: - Add a new inbound or outbound rule to the firewall policy. - Rule name should be unique and cannot be "all". - If a remote computer or user group is specified,security must be authenticate,authenc,authdynenc,or authnoencap. - Setting security to authdynenc allows systems to dynamically negotiate the use of encryption for traffic that matches a given Windows Firewall rule. Encryption is negotiated based on existing connection security rule properties. This option enables the ability of a machine to accept the first TCP or UDP packet of an inbound IPsec connection as long as it is secured,but not encrypted,using IPsec. Once the first packet is processed,the server will re-negotiate the connection and upgrade it so that all subsequent communications are fully encrypted. - If action=bypass,the remote computer group must be specified when dir=i n. - If service=any,the rule applies only to services. - ICMP type or code can be "any". - Edge can only be specified for inbound rules. - AuthEnc and authnoencap cannot be used together. - Authdynenc is valid only when dir=in. - When authnoencap is set,the security=authenticate option becomes an optional parameter. Examples: Add an inbound rule with no encapsulation security for messenger.exe: netsh advfirewall firewall add rule name="allow messenger" dir=in program="c:programfilesmessengermsmsgs.exe" security=authnoencap action=allow Add an outbound rule for port 80: netsh advfirewall firewall add rule name="allow80" protocol=TCP dir=out localport=80 action=block Add an inbound rule requiring security and encryption for TCP port 80 traffic: netsh advfirewall firewall add rule name="Require Encryption for Inbound TCP/80" protocol=TCP dir=in localport=80 security=authdynenc action=allow Add an inbound rule for messenger.exe and require security netsh advfirewall firewall add rule name="allow messenger" dir=in program="c:program filesmessengermsmsgs.exe" security=authenticate action=allow Add an authenticated firewall bypass rule for group acmedomainscanners identified by a SDDL string: netsh advfirewall firewall add rule name="allow scanners" dir=in rmtcomputergrp=<SDDL string> action=bypass security=authenticate Add an outbound allow rule for local ports 5000-5010 for udp- Add rule name="Allow port range" dir=out protocol=udp localport=5000-5010 action=allow (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- .net – 如何通过webclient下载图像(jpg)并保存到Windows P
- Windows中的文件重定向和%errorlevel%
- Windows下编译PHP5.4和xdebug全记录
- 用于在Zune中添加播放列表的API
- windows-7 – SCCM在OSD期间部署Win7 Enterprise选择语言
- windows-8 – 如何强制应用程序在Windows 7/8上使用DPI虚拟
- Win10 x64 安装Eplan P8 2.7 小结
- Windows Phone 7搜索按钮
- 更改单个应用程序的系统颜色(Windows,.NET)
- windows-phone-7 – 在WP7上的“后退”按钮上退出应用程序
- qt – 当Windows上的setRange(0,0)时,将文本放在
- mcrypt在Windows / IIS上的PHP 5.6中不起作用
- windows-phone-7 – IsolatedStorageSettings.Ap
- windows-server-2003 – 反向DNS不会在Windows D
- windows – 捕获VBScript中的任何错误?
- windows-phone-8.1 – 在Visual Studio 2013中建
- .net – Windows播放音频的准确度(就时间而言)?
- Windows上每个Java进程的最大内存量?
- windows-sbs-2008 – 我的公司已经超出了SBS / E
- windows-7 – 我可以创建预激活的Windows 7映像