从侧面加载到与固定internet连接的设备后,远程管理IIS不工作
我必须通过将IIS连接到虚拟机来访问IIS中的某些数据,以避免任何进一步的配置 代码运行良好,但在我侧面加载我的应用程序后,我的应用程序似乎无法再访问我的数据。例如,我的共享文件夹中有一个名为从侧面加载到与固定internet连接的设备后,远程管理IIS不工作,iis,virtual-machine,win-universal-app,wireless,Iis,Virtual Machine,Win Universal App,Wireless,我必须通过将IIS连接到虚拟机来访问IIS中的某些数据,以避免任何进一步的配置 代码运行良好,但在我侧面加载我的应用程序后,我的应用程序似乎无法再访问我的数据。例如,我的共享文件夹中有一个名为Video的文件夹,我刚刚更改了: static string adresse ="http://localhost" 进入 当我无线连接到网络时,该应用程序仍然可以正常运行,但当我使用连接到固定互联网的设备时,我收到一条消息,说它无法连接到服务器 public static async Task&l
Video
的文件夹,我刚刚更改了:
static string adresse ="http://localhost"
进入
当我无线连接到网络时,该应用程序仍然可以正常运行,但当我使用连接到固定互联网的设备时,我收到一条消息,说它无法连接到服务器
public static async Task<List<Uri>> GetMedia()
{
try
{
List<Uri> target = new List<Uri>();
HtmlDocument document = new HtmlDocument();
var httpClient = new HttpClient();
var urlVideos = adresse + "/Videos";
var response = await httpClient.GetAsync(urlVideos);
var result = await response.Content.ReadAsStringAsync();
string htmlString = result;
document.LoadHtml(htmlString);
var collection = document.DocumentNode.DescendantsAndSelf();
foreach (HtmlNode link in collection)
{
if (link.Attributes.Contains("href") && !string.IsNullOrEmpty(link.Attributes["href"].Value.Trim().Trim('/')))
{
target.Add(new Uri(adresse + "" + link.Attributes["href"].Value));
}
}
return target;
}
catch (Exception)
{
string errors = "Proxy.getMedia" + iLine.ToString();
App.ProxyErrors = errors;
throw;
}
}
公共静态异步任务GetMedia()
{
尝试
{
列表目标=新列表();
HtmlDocument document=新的HtmlDocument();
var httpClient=新的httpClient();
var urlvides=adress+“/Videos”;
var response=wait-httpClient.GetAsync(urlvides);
var result=await response.Content.ReadAsStringAsync();
字符串htmlString=结果;
document.LoadHtml(htmlString);
var collection=document.DocumentNode.DegenantsAndSelf();
foreach(集合中的HtmlNode链接)
{
if(link.Attributes.Contains(“href”)&&!string.IsNullOrEmpty(link.Attributes[“href”].Value.Trim().Trim('/'))
{
target.Add(新Uri(adresse+“”+link.Attributes[“href”].Value));
}
}
回报目标;
}
捕获(例外)
{
字符串错误=“Proxy.getMedia”+iLine.ToString();
App.ProxyErrors=错误;
投掷;
}
}
有什么建议吗?我找到了一个解决方案,我只需要转到app.manifest然后就可以了 终端启用专用网络(客户端和服务器)
public static async Task<List<Uri>> GetMedia()
{
try
{
List<Uri> target = new List<Uri>();
HtmlDocument document = new HtmlDocument();
var httpClient = new HttpClient();
var urlVideos = adresse + "/Videos";
var response = await httpClient.GetAsync(urlVideos);
var result = await response.Content.ReadAsStringAsync();
string htmlString = result;
document.LoadHtml(htmlString);
var collection = document.DocumentNode.DescendantsAndSelf();
foreach (HtmlNode link in collection)
{
if (link.Attributes.Contains("href") && !string.IsNullOrEmpty(link.Attributes["href"].Value.Trim().Trim('/')))
{
target.Add(new Uri(adresse + "" + link.Attributes["href"].Value));
}
}
return target;
}
catch (Exception)
{
string errors = "Proxy.getMedia" + iLine.ToString();
App.ProxyErrors = errors;
throw;
}
}