次の方法で共有


SourceRequest.FileType プロパティ (Search)

Web SourceType で返されるファイルの種類 (Microsoft Office Word の .DOC ファイルや Adobe Acrobat .PDF ファイルなど)、または PhoneBook SourceType で返される一覧の種類 (ホワイト ページまたはイエロー ページ) を指定します。

構文

public string FileType { get; set; }

解説

Web SourceType の場合、FileType プロパティでは、ファイル拡張子を指定します。サポートされているファイル拡張子は以下のとおりです。

Web ファイルの種類 FileType プロパティの値

Microsoft Word ドキュメント

DOC

Autodesk Drawing File

DWF

ハイパーテキスト マークアップ言語 (.htm) ファイル

HTM

ハイパーテキスト マークアップ言語 (.html) ファイル

HTML

Adobe Acrobat Portable Document

PDF

Microsoft PowerPoint プレゼンテーション

PPT

Adobe PostScript ドキュメント

PS

Microsoft リッチ テキスト形式ドキュメント

RTF

テキスト ファイル (.text)

TEXT

テキスト ファイル (.txt)

TXT

Microsoft Excel ワークブック

XLS

PhoneBook SourceType の場合、FileType プロパティでは、返される一覧の種類を指定します。サポートされている一覧の種類は以下のとおりです。

電話帳の一覧の種類 FileType プロパティの値

職業別 (イエロー ページ) 一覧

YP

個人別 (ホワイト ページ) 一覧

WP

注意

PhoneBook の一覧の種類である YP および WP は、米国 (en-US および es-US) でのみサポートされています。

この例では、ファイル拡張子が .doc である Web ページの 30 ページ目から 12 ページ分について、Web SourceTypeTitle、Description、および URL フィールドを要求します。それぞれの検索結果のタイトル、説明、および URL がコンソール ウィンドウに表示されます。以下では、FileType プロパティ要求コードを太字で示しています。

try
{
MSNSearchService s = new MSNSearchService();
SearchRequest searchRequest = new SearchRequest();
int arraySize = 1;
SourceRequest[] sr = new SourceRequest[arraySize];

sr[0] = new SourceRequest();
sr[0].Source = SourceType.Web;
sr[0].Count = 12;
    sr[0].FileType = "DOC";
sr[0].Offset = 30;
sr[0].ResultFields = ResultFieldMask.Title | ResultFieldMask.Description | ResultFieldMask.Url;

searchRequest.Query = "microsoft windows vista";
searchRequest.Requests = sr;
// Developer Provisioning System で指定されたアプリケーション ID を 二重引用符で囲って 
// SearchRequest の AppID の値として入力します。
searchRequest.AppID = "YOUR_APP_ID_GOES_HERE";
searchRequest.CultureInfo = "en-US";
SearchResponse searchResponse;

searchResponse = s.Search(searchRequest);

foreach (SourceResponse sourceResponse in searchResponse.Responses)
    {
Result[] sourceResults = sourceResponse.Results;
if (sourceResponse.Total > 0)
        {
Console.WriteLine(sourceResponse.Source.ToString() + " - 結果総数:" + sourceResponse.Total.ToString());
Console.WriteLine();
        }
foreach (Result sourceResult in sourceResults)
        {
if ((sourceResult.Title != null) && (sourceResult.Title != String.Empty))
Console.WriteLine("タイトル:" + sourceResult.Title);
if ((sourceResult.Description != null) && (sourceResult.Description != String.Empty))
Console.WriteLine("説明:" + sourceResult.Description);
if ((sourceResult.Url != null) && (sourceResult.Url != String.Empty))
Console.WriteLine("URL:" + sourceResult.Url);
Console.WriteLine("*****************************************************");
        }
    }
Console.WriteLine("終了するにはいずれかのキーを押してください。");
Console.ReadLine();
}
catch (SoapException fault)
{
Console.WriteLine(fault.Detail.InnerText.ToString());
Console.WriteLine("終了するにはいずれかのキーを押してください。");
Console.ReadLine();

}
catch (WebException webx)
{
Console.WriteLine(webx.ToString());
}

以下の出力の例は、このクエリの結果を示します。

Web - 結果総数: 3637

タイトル:Credential Providers

説明:Microsoft, Visual Studio, Windows, Windows Server, and Windows Vista are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.

URL:http://devreadiness.org/files/9/download.aspx

*****************************************************

タイトル:Worldwide English Product Use Rights - October 2006

説明:For more information about these features, see the Windows Vista Privacy Statement at go.microsoft.com/fwlink/?linkid=20615. By using these features, you consent to the transmission of ...

URL:https://www.microsoftvolumelicensing.com/userights/Pur%20Archive/MicrosoftProductUseRights(Worldwide)(English)(Oct2006).doc

*****************************************************

タイトル:Black Hills Technology Conference & Expo Coming in October

説明:To stay protected from threats on the Internet and wireless networks, the Microsoft Windows client ... power and functionality and the innovative new tools of the soon to be released Windows Vista ...

URL:http://www.rapidcitychamber.com/techexpo/conference/documents/keynote_speaker_info_000.doc

*****************************************************

タイトル:Trend Micro Extends Agreement with Microsoft Corp

説明:??????????????,???Windows Vista Beta?????. ?????? Windows Vista ???????. ?? Windows PC-cillin Internet Security with ...

URL:http://www.trendmicro.com.tw/pr/PressRelease/2006/Trend_060602_Vista.doc

*****************************************************

タイトル:Press Release Leading global Bank

説明:Informaticadienstverlener Getronics is klaar om snel en gemakkelijk breedschalige migraties uit te voeren naar Microsoft Windows Vista.Getronics verbeterde en vernieuwde daartoe zijn eigen ...

URL:http://www.getronics.com/NR/rdonlyres/ef3wb7w4t6ixidr2kewfsgtnbgwcow7b6zfkl6mhke6fge45b3c2cwmbkmkljn75dxjz2hq6numzpzilux5fpb24l4f/GTNRDXNL.doc

*****************************************************

タイトル:2006 ATIA Conference and Exhibition Featured Speakers

説明:Be one of the first people to experience Microsoft Windows Vista.Windows Vista Assistive Technology Day.Presented by Microsoft and HP.Thursday, January 25, 2007

URL:http://www.atia.org/ATIA_2007_Advance_Program.doc

*****************************************************

タイトル:MSDN Authoring Template

説明:Microsoft Windows Vista Compatibility Document .Microsoft Windows Application Experience Group.Last Updated:March 3, 2006. Status:version 1.0 .For feedback and questions please contact the ...

URL:http://www.h2bpro.com/downloads/Vista%20Compatibility%20Guidelines.doc

*****************************************************

タイトル:images10.newegg.com

説明:... Desai, general manager of desktop GPUs at NVIDIA."The same characteristics that make so many gamers select NVIDIA GPUs will greatly benefit mainstream customers when Microsoft Windows Vista ...

URL:http://images10.newegg.com/uploadfilesfornewegg/pressroom/PDFs/HardwareZone

7600gs7300.doc

*****************************************************

タイトル:www.gaetc.org

説明:Microsoft Windows Vista Capable .Built-in 10/100 Ethernet LAN (RJ-45) Weighs 6.3 lbs. and measures 1.4" thin for portable power; lithium-ion battery

URL:http://www.gaetc.org/laptop06.doc

*****************************************************

タイトル:UPA MN Minutes - August 2005

説明:gaynaw@microsoft.com .Topic:Windows Vista.Approaches to research; The usability methods and challenges; How to represent the user and getting others to think about the user

URL:http://www.upamn.org/minutes/2005/UPA-MN_2005_08_11_notes.doc

*****************************************************

タイトル:FOR RELEASE

説明:Additionally, Gates and his team shared a glimpse of Microsoft Windows Vista operating system and demonstrated the clarity, increased confidence and bridge to communication and entertainment the ...

URL:http://www.ce.org/shared_files/pr_attachments/Pre-show%20events%20release.doc

*****************************************************

タイトル:Microsoft Corp

説明:Windows Communication Foundation (WCF) is Microsoft's next generation Web services technology that provides a ...WCF is delivered as a core subsystem of Windows Vista and will also be made ...

URL:http://home.comcast.net/~sdwoodgate/MicrosoftonESB.doc

*****************************************************

終了するにはいずれかのキーを押してください。