我正在尝试搜索可在另一台服务器上公开访问的文件夹,但我的应用程序一直收到以下错误:
消息:无法连接到远程服务器
StackTrace:在System.Net.HttpWebRequest.GetResponse() 在Commission:_decisions._Default.uiSearchTermButton_Click(对象发件人,EventArgs e)在d:\ websites92 \ MainSite92 \ commissioner_decisions \ Default.aspx.cs:第500行 日期:6/19/2017 9:59:52 AM .... 061 [2] R6180
我很确定它与IIS权限有关,但我不确定如何授予文件夹权限。
任何帮助都将不胜感激。
以下是代码:
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++;
}