http://www.dscredstorm.com/getisbninfo.aspx
AmazonのAPIを使用しようとしています。C# Windows フォーム アプリであるサンプル コードをダウンロードしましたが、C# Web サイトでも機能するはずだと思いました。正しいですか?
SignedRequestHelper.cs は、署名された要求を送信するために必要な機能を備えているように見えるファイルです。名前空間は AmazonProductAdvtApi です。ファイルを App_Code/Csharp に置き、「using AmazonProductAdvtApi;」を追加しました。マイページへ。
しかし、次のエラーが表示されます:「AmazonProductAdvtApi.SignedRequestHelper」は、保護レベルが原因でアクセスできません
なんで?
詳細: SignedRequestHelper helper = new SignedRequestHelper(accessKeyId, secretKey, destination);
参照: http://www.dscredstorm.com/getisbninfo.aspx
SignedRequestHelper.cs のクラス宣言は次のとおりです。
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Security.Cryptography;
namespace AmazonProductAdvtApi
{
class SignedRequestHelper
...
... some private consts and vars...
public SignedRequestHelper(string awsAccessKeyId, string awsSecretKey, string destination)
{
this.endPoint = destination.ToLower();
this.akid = awsAccessKeyId;
this.secret = Encoding.UTF8.GetBytes(awsSecretKey);
this.signer = new HMACSHA256(this.secret);
}