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++;
}