コード例 #1
0
ファイル: Program.cs プロジェクト: 9nick9/MRPCode
        static string SearchBing(string company, BingSearchContainer bingSearch, bool needTwitter = false)
        {
            if (needTwitter)
            {
                company = "twitter: " + company;
            }

            DataServiceQuery <WebResult> result = bingSearch.Web(company, "DisableLocationDetection", null, "en-US", null, null, null, null);
            WebResult firstResult = result.FirstOrDefault();

            if (needTwitter)
            {
                return(ParseOutTwitterHandle(firstResult));
            }

            if (firstResult != null)
            {
                return(firstResult.Url);
            }

            return("");
        }