DoboWiki
Top
> 自由区/Webサービス紹介/Amazon E-Commerce Service/Code/VB.NET/SellerListingSearch をテンプレートにして作成
自由区/Webサービス紹介/Amazon E-Commerce Service/Code/VB.NET/SellerListingSearch をテンプレートにして作成
開始行:
*SellerListingSearchのサンプルコード(VB.NET) [#t8088cf4]
ここで紹介しているコードは[[こちらのプロキシクラス>../../...
ここで紹介しているコードは[[こちらのC#のコード>../../CS/S...
指定した出品者が出品している商品を表示するサンプルです。T...
#code(vbnet){{
<%@ Page Language="VB" %>
<%@ Import Namespace="Amazon.jp.v20060913" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional...
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub Button1_Click(ByVal sender As Object, _
ByVal e As EventArgs)
Dim req As New SellerListingSearchRequest()
'Seller IDを指定する
req.SellerId = TextBox1.Text
'タイトル名で並べる
req.Sort = "title"
Dim sls As New SellerListingSearch()
'あなたのAccess Key ID
sls.AWSAccessKeyId = "(あなたのAccessKeyID)"
'あなたのAssociate ID
sls.AssociateTag = "dobonnet-22"
sls.Request = New SellerListingSearchRequest() {r...
Dim aws As New AWSECommerceService()
Dim res As SellerListingSearchResponse
Try
'SellerListingSearchオペレーションを実行し、...
res = aws.SellerListingSearch(sls)
Catch ex As Exception
Label1.Text = "エラー:" + Server.HtmlEncode(...
Return
End Try
If res Is Nothing OrElse res.SellerListings Is No...
Label1.Text = "結果を取得できませんでした。"
Return
End If
If Not (res.SellerListings(0).Request.Errors Is N...
Label1.Text = "エラー:" + _
res.SellerListings(0).Request.Errors(0).M...
Return
End If
If res.SellerListings(0).SellerListing Is Nothing...
Label1.Text = "該当するSellerのリストが見つか...
Return
End If
'結果を表示
Dim listings As SellerListings = res.SellerListin...
Label1.Text += "総数 : " + listings.TotalResults ...
Label1.Text += "<ul>" + vbLf
Dim sl As SellerListing
For Each sl In listings.SellerListing
Label1.Text += "<li><b>" + sl.Title + "</b><b...
Label1.Text += "価格 : " + sl.Price.Formatted...
"<br />" + vbLf
Label1.Text += "ExchangeID : " + sl.ExchangeI...
"<br />" + vbLf
Label1.Text += "ASIN : " + sl.ASIN + "<br />"...
Label1.Text += "ListingId : " + sl.ListingId ...
"<br />" + vbLf
Next sl
Label1.Text += "</ul>" + vbLf
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Amazon出品者の商品リスト表示</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<label for="TextBox1">出品者のID : </label>
<asp:TextBox ID="TextBox1" runat="server"></asp:T...
<asp:Button ID="Button1" runat="server"
OnClick="Button1_Click" Text="送信" /><br />
</div>
</form>
<br />
<asp:Label ID="Label1" runat="server" EnableViewState...
</asp:Label>
</body>
</html>
}}
//これより下は編集しないでください
#pageinfo([[:Category/.NET]] [[:Category/ASP.NET]],2006-1...
終了行:
*SellerListingSearchのサンプルコード(VB.NET) [#t8088cf4]
ここで紹介しているコードは[[こちらのプロキシクラス>../../...
ここで紹介しているコードは[[こちらのC#のコード>../../CS/S...
指定した出品者が出品している商品を表示するサンプルです。T...
#code(vbnet){{
<%@ Page Language="VB" %>
<%@ Import Namespace="Amazon.jp.v20060913" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional...
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub Button1_Click(ByVal sender As Object, _
ByVal e As EventArgs)
Dim req As New SellerListingSearchRequest()
'Seller IDを指定する
req.SellerId = TextBox1.Text
'タイトル名で並べる
req.Sort = "title"
Dim sls As New SellerListingSearch()
'あなたのAccess Key ID
sls.AWSAccessKeyId = "(あなたのAccessKeyID)"
'あなたのAssociate ID
sls.AssociateTag = "dobonnet-22"
sls.Request = New SellerListingSearchRequest() {r...
Dim aws As New AWSECommerceService()
Dim res As SellerListingSearchResponse
Try
'SellerListingSearchオペレーションを実行し、...
res = aws.SellerListingSearch(sls)
Catch ex As Exception
Label1.Text = "エラー:" + Server.HtmlEncode(...
Return
End Try
If res Is Nothing OrElse res.SellerListings Is No...
Label1.Text = "結果を取得できませんでした。"
Return
End If
If Not (res.SellerListings(0).Request.Errors Is N...
Label1.Text = "エラー:" + _
res.SellerListings(0).Request.Errors(0).M...
Return
End If
If res.SellerListings(0).SellerListing Is Nothing...
Label1.Text = "該当するSellerのリストが見つか...
Return
End If
'結果を表示
Dim listings As SellerListings = res.SellerListin...
Label1.Text += "総数 : " + listings.TotalResults ...
Label1.Text += "<ul>" + vbLf
Dim sl As SellerListing
For Each sl In listings.SellerListing
Label1.Text += "<li><b>" + sl.Title + "</b><b...
Label1.Text += "価格 : " + sl.Price.Formatted...
"<br />" + vbLf
Label1.Text += "ExchangeID : " + sl.ExchangeI...
"<br />" + vbLf
Label1.Text += "ASIN : " + sl.ASIN + "<br />"...
Label1.Text += "ListingId : " + sl.ListingId ...
"<br />" + vbLf
Next sl
Label1.Text += "</ul>" + vbLf
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Amazon出品者の商品リスト表示</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<label for="TextBox1">出品者のID : </label>
<asp:TextBox ID="TextBox1" runat="server"></asp:T...
<asp:Button ID="Button1" runat="server"
OnClick="Button1_Click" Text="送信" /><br />
</div>
</form>
<br />
<asp:Label ID="Label1" runat="server" EnableViewState...
</asp:Label>
</body>
</html>
}}
//これより下は編集しないでください
#pageinfo([[:Category/.NET]] [[:Category/ASP.NET]],2006-1...
ページ名:
▲
▼
[
トップ
] [
新規
|
子ページ作成
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]