次の方法で共有


Result.Summary プロパティ (Search)

SourceRequest に対する Summary テキストを返します。InlineAnswers の結果のすべてのタイプに適用されます。

構文

public string Summary { get; set; }

解説

サマリ文字列には、リソースから返された情報のテキスト形式の要約が含まれており、主に SMS メッセージングを使用するモバイル デバイスで使用されます。

商業的利用のために確保されています。このサービスの商業的利用の詳細については、api_tou@microsoft.com までお問い合わせください (英語のみ)。

この例では、6 つの結果のタイプ MusicIA、SportsIA、EncartaIAFinanceIA、ShowTimesIA、 および WeatherIA のすべての InlineAnswers SourceType から情報を返します。

for (int i = 0; i < 6; i++)
{
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.InlineAnswers;
sr[0].ResultFields = ResultFieldMask.All | ResultFieldMask.Summary | ResultFieldMask.ResultType;

switch(i)
        {
case 0:
searchRequest.Query = "population of china";
break;
case 1:
searchRequest.Query = "msft";
break;
case 2:
searchRequest.Query = "weather new york";
break;
case 3:
searchRequest.Query = "casino royale redmond";
break;
case 4:
searchRequest.Query = "mariah carey";
break;
case 5:
searchRequest.Query = "peyton manning";
break;
default:
searchRequest.Query = "population of china";
break;
        }
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 (searchResponse.Responses[0].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.Source != null) && (sourceResult.Source != String.Empty))
Console.WriteLine("ソース:" + sourceResult.Source);
if ((sourceResult.ResultType != null) && (sourceResult.ResultType != String.Empty))
Console.WriteLine("結果のタイプ:" + sourceResult.ResultType);
                if ((sourceResult.Summary != null) && (sourceResult.Summary != String.Empty))
                    Console.WriteLine("概要:" + sourceResult.Summary);
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());
    }
}
Console.WriteLine("終了するにはいずれかのキーを押してください。");
Console.ReadLine();

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

InlineAnswers - 結果総数: 4

タイトル:China:Population, total:1,313,973,700

説明:2006 estimate:United States Census International Programs Center

ソース:United States Census International Programs Center

結果のタイプ:EncartaIA

概要:China:Population, total:1,313,973,700

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

タイトル:China, Mexico:Population, total:11,540

説明:2000:Instituto Nacional De Estadistica Geograpfia E Informatica (Mexico)

ソース:Instituto Nacional De Estadistica Geograpfia E Informatica (Mexico)

結果のタイプ:EncartaIA

概要:China, Mexico:Population, total:11,540

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

タイトル:China, Japan:Population, total:7,171

説明: 2005:

結果のタイプ:EncartaIA

概要:China, Japan:Population, total:7,171

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

タイトル:Chiná, Mexico:Population, total:3,354

説明:1990:Instituto Nacional De Estadistica Geograpfia E Informatica (Mexico)

ソース:Instituto Nacional De Estadistica Geograpfia E Informatica (Mexico)

結果のタイプ:EncartaIA

概要:Chiná, Mexico:Population, total:3,354

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

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

InlineAnswers - 結果総数: 3

タイトル:US:MSFT

説明:Microsoft Corporation

結果のタイプ:FinanceIA

概要:MSFT:Microsoft Corporation, 30.72, -0.39(-1.25%), Volume 56.15M; Data in USD; Quotes By Comstock, 20 min delay

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

タイトル:MySpace Sues Colo. Man for Alleged Spam

ソース:AP

結果のタイプ:FinanceIA

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

タイトル:Data Retention Raises Cost Concerns

ソース:AP

結果のタイプ:FinanceIA

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

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

InlineAnswers - 結果総数: 1

タイトル:Weather in New York, NY

説明:New York, NY; Mon:31F, 3 mph W, 75%, Cloudy, 36/27

結果のタイプ:WeatherIA

概要:New York, NY; Mon:31F, Cloudy, 36/27; Tue:Partly Cloudy, 36/27; Wed:Sprinkles, 40/23; Thu:Scattered Flurries, 29/20; Fri:Fair, 20/16; Data provided by Foreca

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

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

InlineAnswers - 結果総数: 5

タイトル:Casino Royale

説明:(800)326-3264 - 8890 161st Ave N.E., Redmond, WA 98052

結果のタイプ:ShowTimesIA

概要:Casino Royale, PG13, Spy Film, 144 min, Regal Bella Bottega 11, M-Th:(1PM 4:10) 7:20 10:25、(800)326-3264

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

タイトル:Casino Royale

説明:(425) 454-7400 - 700 Bellevue Way NE - Lincoln Square, Bellevue, WA 98004

結果のタイプ:ShowTimesIA

概要:Casino Royale, PG13, Spy Film, 144 min, Lincoln Square Cinemas, M-Th:(1:30PM 4:45) 8、(425) 454-7400

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

タイトル:Casino Royale

説明:(206) 781-5755 - 4500 9th NE, Seattle, WA 98105

結果のタイプ:ShowTimesIA

概要:Casino Royale, PG13, Spy Film, 144 min, Landmark Metro Cinemas, M-Th:12:30PM 6:30、4500 9th NE, Seattle、(206) 781-5755

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

タイトル:Casino Royale

説明:(206) 652-2404 - 6th and Pine, Seattle, WA 98101

結果のタイプ:ShowTimesIA

概要:Casino Royale, PG13, Spy Film, 144 min, AMC Pacific Place 11, M-Th:1:20PM 4:30 7:30 10:30、6th and Pine、(206) 652-2404

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

タイトル:Casino Royale

説明:(206) 256-0572 - 2505 1st Avenue at Wall Street, Seattle, WA 98121

結果のタイプ:ShowTimesIA

概要:Casino Royale, PG13, Spy Film, 144 min, Big Picture, Tu-Th:5PM 8、2505 1st Avenue at Wall Street、(206) 256-0572

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

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

InlineAnswers - 結果総数: 1

タイトル:Mariah Carey

説明:The best-selling female performer of the 1990s, Mariah Carey rose to superstardom on the strength of her stunning five-octave voice; an elastic talent who moved easily from glossy ballads to hip-hop-inspired dance-pop, she earned frequent comparison to rivals Whitney Houston and Celine Dion, but did them both one better by composing all of her own material.Born in Long Island, NY, on March 27, 1970, Carey moved to New York City at the age of 17 -- just one day after graduating high sch

結果のタイプ:MusicIA

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

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

InlineAnswers - 結果総数: 1

タイトル:Peyton Manning

説明:nfl:Player - Player - Game

結果のタイプ:SportsIA

概要:Att: 20

firstName:Peyton

GP: 16

headShotUrl:http://msn.foxsports.com/fe/img/NFL/Headshots/4256.jpg

height: 77

id: 4256

Int: 14

lastName:Manning

number: 18

PassTD: 31

PassYds: 4040

PlayerUrl:http://msn.foxsports.com/NFL/player?statsId=4256

Position:QB

Pts: 18

Rating: 98.0

RushAvg: -0.3

RushTD: 3

RushYds: -5

School:Tennessee

teamCity:Indianapolis

teamCode: 11

teamName:Colts

teamUrl:http://msn.foxsports.com/NFL/team/67048

weight: 230

Game:Chargers at Colts, 1/13 13:00 Eastern Final 28-24

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

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

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