`
lindexi-gd
  • 浏览: 131541 次
社区版块
存档分类
最新评论

解决 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>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics