简体   繁体   English

从我们的ASP.NET内部网(C#)启动URL

[英]Starting a URL from our ASP.NET intranet (C#)

I'm simply trying to call a URL from our Office Intranet, but depending on how I call it, it either acts like it did nothing (1st example), or throws an Access Denied error (2nd example). 我只是试图从我们的Office Intranet调用URL,但是根据我的调用方式,它要么表现为什么都不做(第一个示例),要么抛出“拒绝访问”错误(第二个示例)。 However, if I run either of the following in Visual Studio 2013 (C#) they work great -- opens a new tab and goes to the site! 但是,如果我在Visual Studio 2013(C#)中运行以下任一程序,则它们会很好用-打开一个新选项卡,然后转到网站! When I publish it to our intranet, however, it doesn't work. 但是,当我将其发布到我们的Intranet时,它不起作用。

    ProcessStartInfo startInfo = new ProcessStartInfo("chrome.exe", "https://google.com");
    Process.Start(startInfo);

Or, 要么,

    System.Diagnostics.Process.Start("https://google.com");

Referring to the 2nd example, I'm assuming it has something to do with running it locally in VS. 参考第二个示例,我假设它与在VS中本地运行有关。 I read an article that said to try setting your service account to 'Local Service', which I did, but got the same error (access denied). 我读了一篇文章,内容是尝试将您的服务帐户设置为“本地服务”,但我遇到了同样的错误(访问被拒绝)。 The same article then said to check the permissions on the application. 然后说同一篇文章来检查应用程序的权限。 With an office intranet w/master pages, what permission on what files would I change -- if this is even the problem? 使用带有主页的Office Intranet,我将更改哪些文件的权限-即使这是问题所在? I gave the .aspx page that's got the URL call in it to have Full Control, which still gave the access denied error. 我给了带有URL调用的.aspx页面以“完全控制”,但仍给出了拒绝访问错误。

If I go to our server that's running IIS, open a browser, put the URL in, it goes to the site just fine -- meaning that server can get to the Internet. 如果我转到运行IIS的服务器,请打开浏览器,将URL放入其中,它就可以正常访问网站了-这意味着该服务器可以访问Internet。 Sorry I don't know a ton about setup on IIS or security on servers hosting intranets. 抱歉,我对IIS设置或托管Intranet的服务器的安全性一无所知。

I stumbled upon the following, simple solution, to the above issue by searching the web getting ideas from links and anchor tags, etc. Here's all I had to do to make this work on our Intranet: 我通过搜索网络从链接和锚标记等中获取想法,偶然发现了上述问题的以下简单解决方案。这是我在Intranet上进行此工作所需要做的全部工作:

Response.Redirect("https://google.com?param1=Dog");

Thanks for anyone trying to help! 感谢任何尝试提供帮助的人!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM