解决 Win10 UWP 无法使用 ss 连接
2024-10-09 18:20:13
一旦使用了 ss, 那么很多应用就无法连接网络。
本文提供一个方法可以简单使用ss提供的代理。
多谢 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 ),不得用于商业目的,基于本文修改后的作品务必以相同的许可发布。如有任何疑问,请与我联系。
最新文章
- cron 任务
- Python之路Day20-Django一对一(多)以及Ajax
- winform空间批量控制
- python核心编程第六章练习6-11
- [转]关闭ORACLE数据库
- ROC和AUC介绍以及如何计算AUC ---好!!!!
- Unity3d:Unknown type 'System.Collections.Generic.CollectionDebuggerView'1
- 【转】setAnimation和startAnimation区别
- Selenium 2.0 WebDriver 自动化测试 使用教程 实例教程 API快速参考
- oracle一直不确定的distinct多字段处理情况整理
- Bagging与方差
- Spring Boot 自定义 starter
- Python爬取今日头条段子
- 014 在Spark中完成PV与UV的计算,重在源代码
- C# 装箱
- MySQL表中的数据类型
- LeetCode题解之 Implement strStr()
- ORA-01950: no privileges on tablespace xxx ORA-01950: 对表空间 'xxx'无权限
- SpringMVC 之 Hello World 入门
- RabbitMQ上手记录–part 4-节点集群(单机多节点)