2017-06-04 18 views
1

私はPoloniexウェブサイトに接続するためにC#コードを使用しています。 暗号化交換。私は2つのキーを持っています、最初はAPIキー、最後はPoloniexによって作成され、メールで私に送られました。私はPublicKeyの最初の キーを使用し、PrivateKeyの最後のキーを使用しました。 クラスのPublicKeyおよび PrivateKey。 Poloniex Poloniex APIをC#でリアルタイム価格データを取得するには

  • のAPIキー:私はプログラムを実行すると、私 はエラー

    Additional information: The remote server returned an error: (403) Forbidden".

    [PoloniexApi.Net]プロジェクト(https://github.com/kripod/PoloniexApi.Net

    struct ApiKeys 
    { 
        // WARNING: In order not to expose the changes of this file to git, please 
        //   run the following command every time you clone the repository: 
        // git update-index --assume-unchanged "PoloniexApi.Net.Demo\ApiKeys.cs" 
         internal const string PublicKey = "SUL0JADV-ZL02L4XQ-RZ9S0LIK-PIEJUAMD"; 
        internal const string PrivateKey = "4ac7bf2566503abc38e728ff72fc114ca2831bddd0ed0d432ba71da3a4dea36082a169cab5ffffcc1383ad23b60145bbb2d15da9f6396"; 
    } 
    
    • のPublicKeyのリンクを得ましたPrivateKey:メールに送信されたキーPoloniex

    enter image description here

  • +0

    私も2つのキーを交換して、同じエラーが発生しました。 –

    +0

    また、Webサービスにリクエストを送信する方法(URLの設定方法など)など、関連するコードをいくつか表示します。 – kennyzx

    答えて

    1

    例外ブロックを実行する必要があります。例:

    try 
    { 
        var curr = CurrencyPair.Parse(Scurr); 
        var trade = await PoloniexClient.Trading.GetTradesAsync(curr); 
        dataGridTradeHistory.Rows.Clear(); 
        foreach (var trd in trade) 
        { 
        dataGridTradeHistory.Rows.Add(trd.Time, trd.Type, trd.IdOrder.ToString(), 
        trd.PricePerCoin, trd.AmountBase, trd.AmountQuote); 
        } 
    } 
    catch { } 
    
    関連する問題