简体   繁体   中英

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). 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! When I publish it to our intranet, however, it doesn't work.

    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. 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? I gave the .aspx page that's got the URL call in it to have Full Control, which still gave the access denied error.

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. Sorry I don't know a ton about setup on IIS or security on servers hosting intranets.

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:

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

Thanks for anyone trying to help!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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