解决 Win10 UWP 无法使用 ss 连接

一旦使用了 ss, 那么很多应用就无法连接网络。

本文提供一个方法可以简单使用ss提供的代理。

<!--more-->

多谢 wtwsgs 提供方法:http://blog.csdn.net/wtwsgs/article/details/51333912

代码很少,可以自己复制放在vs运行

     class Program
    {
        static void Main(string[] args)
        {
            //%USERPROFILE%\AppData\Local\Packages
            string str = "%USERPROFILE%\\AppData\\Local\\Packages";
            str = Environment.ExpandEnvironmentVariables(str);
            DirectoryInfo dir = new DirectoryInfo(str);
            foreach (var temp in dir.GetDirectories())
            {
                str = "CheckNetIsolation.exe LoopbackExempt -a -n=\"" + temp.Name + "\"";
                Control(str);
            }
        }

        private static string Control(string str)
        {
            Process p = new Process();
            p.StartInfo.FileName = "cmd.exe";
            p.StartInfo.UseShellExecute = false; 
            p.StartInfo.RedirectStandardInput = true; 
            p.StartInfo.RedirectStandardOutput = true; 
            p.StartInfo.RedirectStandardError = true; 
            p.StartInfo.CreateNoWindow = true; 
            p.StartInfo.StandardOutputEncoding = Encoding.UTF8;
            p.Start(); 

            p.StandardInput.WriteLine(str + "&exit");

            p.StandardInput.AutoFlush = true;

            string output = p.StandardOutput.ReadToEnd();
            output += p.StandardError.ReadToEnd();


            p.WaitForExit(); 
            p.Close();

            return output + "\r\n";
        }
    }

如果不想在 vs 编译,可以下载编译的:http://download.csdn.net/detail/lindexi_gd/9823838

需要使用管理员打开

https://github.com/shadowsocks/shadowsocks-windows/issues/932

http://krblog.krrrrr.xyz/md/post/105

知识共享许可协议
本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可。欢迎转载、使用、重新发布,但务必保留文章署名林德熙(包含链接:http://blog.csdn.net/lindexi_gd ),不得用于商业目的,基于本文修改后的作品务必以相同的许可发布。如有任何疑问,请与我联系

<script type="text/javascript"> $(function () { $('pre.prettyprint code').each(function () { var lines = $(this).text().split('\n').length; var $numbering = $('<ul/>').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i <= lines; i++) { $numbering.append($('<li/>').text(i)); }; $numbering.fadeIn(1700); }); }); </script>

转载于:https://www.cnblogs.com/lindexi/p/6949660.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值