System.IO.IOException:发生意外的网络错误

时间:2013-12-05 23:50:23

标签: c# asp.net

我们的网站在白天工作得很好,并且主要在夜间抛出此错误。我是.net的新手所以请告诉我这是从代码后端还是内部服务器设置中处理的问题。另外,我如何确定查找错误的确切页面?

[IOException: An unexpected network error occurred.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +7718492
System.IO.FileStream.ReadCore(Byte[] buffer, Int32 offset, Int32 count) +7478337
System.IO.FileStream.Read(Byte[] array, Int32 offset, Int32 count) +264
System.IO.BinaryReader.Read(Byte[] buffer, Int32 index, Int32 count) +85
Lucene.Net.Store.SimpleFSIndexInput.ReadInternal(Byte[] b, Int32 offset, Int32 len) +332
Lucene.Net.Store.BufferedIndexInput.ReadBytes(Byte[] b, Int32 offset, Int32 len, Boolean useBuffer) +647
Lucene.Net.Index.CSIndexInput.ReadInternal(Byte[] b, Int32 offset, Int32 len) +242
Lucene.Net.Store.BufferedIndexInput.Refill() +410
Lucene.Net.Store.BufferedIndexInput.ReadByte() +78
Lucene.Net.Store.IndexInput.ReadVInt() +60
Lucene.Net.Index.TermBuffer.Read(IndexInput input, FieldInfos fieldInfos) +64
Lucene.Net.Index.SegmentTermEnum.Next() +244
Lucene.Net.Index.SegmentTermEnum.ScanTo(Term term) +110
Lucene.Net.Index.TermInfosReader.Get(Term term, Boolean useCache) +633
Lucene.Net.Index.TermInfosReader.Terms(Term term) +45
Lucene.Net.Index.SegmentReader.Terms(Term t) +71
Lucene.Net.Index.MultiTermEnum..ctor(IndexReader topReader, IndexReader[] readers, Int32[] starts, Term t) +227
Lucene.Net.Index.DirectoryReader.Terms(Term term) +80
Lucene.Net.Search.NumericRangeTermEnum.Next() +562
Lucene.Net.Search.NumericRangeTermEnum..ctor(NumericRangeQuery enclosingInstance, IndexReader reader) +2295
Lucene.Net.Search.NumericRangeQuery.GetEnum(IndexReader reader) +59
Lucene.Net.Search.ConstantScoreAutoRewrite.Rewrite(IndexReader reader, MultiTermQuery query) +272
Lucene.Net.Search.MultiTermQuery.Rewrite(IndexReader reader) +54
Lucene.Net.Search.BooleanQuery.Rewrite(IndexReader reader) +503
Lucene.Net.Search.IndexSearcher.Rewrite(Query original) +68
Lucene.Net.Search.Query.Weight(Searcher searcher) +72
Lucene.Net.Search.Searcher.CreateWeight(Query query) +42
Lucene.Net.Search.Searcher.Search(Query query, Collector results) +43
Seamless.CMS.WebUI.CustomControls.SCLuceneHelper.SearchSCData(SearchCriteria criteria, SeamlessList`1& listResultItem, String& filter, Query& highlighterQuery) +2519
Seamless.CMS.WebUI.CustomControls.SCSearchList.Find(SearchCriteria searchConditions) +128
Seamless.CMS.WebUI.CustomControls.SCSearchList.InitialSearch() +712
Seamless.CMS.WebUI.CustomControls.SCSearchList.PageLoad() +690
Seamless.CMS.WebUI.CustomControls.SCSearchList.Page_Load(Object sender, EventArgs e) +35
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

我在搜索页面下找到了这个。

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Seamless.Web;
using System.Collections.Generic;

namespace Seamless.CMS.WebUI.CustomControls
{
public partial class Search : ControlBase, ISeamlessCMSControl
{

    #region Properties
    public string searchResultUrl
    {
        set { ViewState["searchResultUrl"] = value; }
        get
        {
            if (ViewState["searchResultUrl"] == null)
                ViewState["searchResultUrl"] = "";
            return (string)ViewState["searchResultUrl"];
        }
    }
    #endregion


    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
            if (Request.QueryString["query"] != null)
                txtSearch.Text = Server.UrlDecode(Request.QueryString["query"].ToString());

    }

    protected void btnSearch_Click(object sender, EventArgs e)
    {
        Response.Redirect(CMSSettings.GetVirtualPathRoot() + searchResultUrl + "?keyword=" + Server.UrlEncode(txtSearch.Text.Replace("+", "").Replace(".", "").Trim()));
    }

    #region ISeamlessCMSControl Members

    public List<CustomControlProperty> GetProperties()
    {
        List<CustomControlProperty> ccpList = new List<CustomControlProperty>();
        CustomControlProperty ccp = new CustomControlProperty();

        ccp = new CustomControlProperty();
        ccp.controlType = CustomControlProperty.ControlTypes.Textbox;
        ccp.name = "searchResultUrl";
        ccp.description = "The url containing the search result list";
        ccp.propertyType = "string";
        ccp.controlValues.Add(new ListItem("", ""));
        ccpList.Add(ccp);

        return ccpList;
    }

    #endregion
}

}

0 个答案:

没有答案