掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
C266エラーをなくすには? (ID:59181)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
http://www.gotdotnet.com/japan/student/column/firststep/firststep18.aspx ↑のページをやっています。 しかし、私の環境は、Visual C++ .NET 2003 上記URLの環境はVC# .NETで書いてある。 /* ダウン対象URLと 保存先パスの取得 */ downurl = this->TextUrl->Text; filepath = this->textFilePath->Text; /* ダウンロード対象ページtemp.htmlとして保存 */ WebClient* myWebClient = new WebClient(); myWebClient->DownloadFile(downurl,"c:\temp.html"); /* c:\temp.html の内容を contents に格納 */ StreamReader* reader = File::OpenText("c:\temp.html"); contents = reader->ReadToEnd(); reader->Close(); // contents からリンク情報のリストを抽出 System::Text::RegularExpressions::Regex *regex = new System::Text::RegularExpressions::Regex("<a +href=('|\")[^('|\")]*('|\") *>"); System::Text::RegularExpressions::MatchCollection *matchcollection = regex->Matches(contents); // 各リンク情報から URL情報 を排出し、DL for(i=0;i<matchcollection->Count;++i) { /* 各リンク情報から URL情報 を排出 */ System::Text::RegularExpressions::Regex *urlregex = new System::Text::RegularExpressions::Regex("('|\")[^('|\")]*('|\")"); System::Text::RegularExpressions::Match *match = urlregex->Match(matchcollection->Item[i]); url = match->Value->Substring(1, match->Value->Length-2); /* 排出されたやつをテキストボックスに表示 */ this->textUrlList->Text = String::Concat(textUrlList->Text,url); this->textUrlList->Text = String::Concat(textUrlList->Text,"\r\n"); このソースの urlregex->Match(matchcollection->Item[i]); でエラーが発生。 error C2664: 'System::Text::RegularExpressions::Match __gc *System::Text::RegularExpressions::Regex::Match(System::String __gc *)' : 1 番目の引数を 'System::Text::RegularExpressions::Match __gc *' から 'System::String __gc *' に変換できません。 ぐぐってみても、さっぱりなので、よろしくお願いします
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.