asp.net アプリケーションで Keyword Query オブジェクトを使用しようとしています。
私はこのコードを書きました:
名前空間: System.Data.SqlClient を使用します。Microsoft.SharePoint を使用。Microsoft.SharePoint.Search を使用します。Microsoft.SharePoint.Search.Query を使用します。
ページ読み込みイベント: GridView grd = new GridView(); DataTable dt = 新しい DataTable(); KeywordQuery qRequest = new KeywordQuery(" http://server/ril "); qRequest.QueryText = "RILLIB"; ResultTableCollection resTableCollect = qRequest.Execute(); ResultTable resTable = resTableCollect[ResultType.RelevantResults]; データテーブル dtTable = new DataTable(); dtTable.Load(resTable, LoadOption.OverwriteChanges); grd.DataSource = dtTable; grd.DataBind();
Page.Controls.Add(grd);
Ok?実行するとエラーが発生します: HRESULT からの例外: 0xC0041228
ログを見たとき、これらの行を見つけました。正確には何のエラーですか?どうすればそれを削除できますか?
イベントの種類: エラー イベント ソース: Office SharePoint Server イベント カテゴリ: Office Server 共有サービス イベント ID: 6481 日付: 05/11/2009 時刻: 6:12:25 PM ユーザー: N/A コンピューター: SERVER 説明: アプリケーション サーバー ジョブが失敗しましたサービス インスタンス Microsoft.Office.Server.Search.Administration.SearchServiceInstance (41fdea47-166f-4d9f-9cd0-4f3dd0f5cd5b) の場合。
理由: パス「C:\WINDOWS\system32\drivers\etc\HOSTS」へのアクセスが拒否されました。
テクニカル サポートの詳細: System.UnauthorizedAccessException: パス 'C:\WINDOWS\system32\drivers\etc\HOSTS' へのアクセスが拒否されました。System.IO.__Error.WinIOError (Int32 errorCode、文字列の多分フルパス) で System.IO.FileStream.Init (文字列パス、FileMode モード、FileAccess アクセス、Int32 権限、ブール値の useRights、FileShare 共有、Int32 bufferSize、FileOptions オプション、SECURITY_ATTRIBUTES secAttrs , String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.StreamWriter.CreateFile(String path, Boolean append) System.IO.StreamWriter..ctor (文字列パス、ブール値の追加、エンコーディング エンコーディング、Int32 bufferSize) で System.IO.StreamWriter..ctor (文字列パス、ブール値の追加) で System.IO.FileInfo。
詳細については、ヘルプとサポート センター ( http://go.microsoft.com/fwlink/events.asp ) を参照してください。