0

I'm trying to search through folders that are publicly accessible on another server but my application keeps getting the following error:

Message :Unable to connect to the remote server
StackTrace : at System.Net.HttpWebRequest.GetResponse() at commissioners_decisions._Default.uiSearchTermButton_Click(Object sender, EventArgs e) in d:\websites92\MainSite92\commissioner_decisions\Default.aspx.cs:line 500 Date :6/19/2017 9:59:52 AM....061[2]R6180

I'm pretty sure it has to do with the IIS permissions but I'm not sure what to give permissions to on the folders.

Any help would be appreciated.

Here's the code:

bool found = false;
Spire.Doc.Documents.TextSelection ts = null;
Stream stream = null;
MemoryStream stream2 = new MemoryStream();
HttpWebRequest docRequest = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse docResponse = (HttpWebResponse)docRequest.GetResponse();
stream = docResponse.GetResponseStream();
stream.CopyTo(stream2);
stream2.Position = 0;
Spire.Doc.Document document = new Spire.Doc.Document();
document.LoadFromStream(stream2, FileFormat.Auto);
ts = document.FindString(txtBasicSearch.Text, false, true);
if (ts != null)
{
     found = true;
}
if (found)
{
     hearingArrayList.Add(h);
     foundCount++;
}
5
  • can you show us the code? Commented Jun 19, 2017 at 15:33
  • Do you try to read from a network share? Commented Jun 19, 2017 at 15:37
  • Are these servers on the same domain? That makes this setup easier.
    – ps2goat
    Commented Jun 19, 2017 at 16:38
  • Same domain but I don't know if they're on the same vlan, it's not from a network share, but I could set it up that way if it's easier
    – Erik Felde
    Commented Jun 19, 2017 at 16:53
  • Using RunAs, open an instance of IE as the user under which your program runs (e.g. its service account) and paste the url into the address bar. What do you get back?
    – John Wu
    Commented Jun 19, 2017 at 17:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.