因此,我正在尝试构建一个访问 Etsy API 的程序,到目前为止,我所做的只是使用 OAuth 对其进行调用,然后它会引发此异常。
'调用与指定绑定约束匹配的'testEtsy.MainWindow'类型的构造函数引发异常。行号“3”和行位置“9”。
这是我的 XAML
<Window x:Class="testEtsy.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid></Grid>
这是我在 MainWindow.cs 中的代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace testEtsy
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
string[] orderNumbers = System.IO.File.ReadAllLines(@"F:\ordernumbers.txt");
public static void getOAuthKey()
{
string ConsumerKey = "q6uqzk27z2yw4tl5s4qerdtp";
string ConsumerSecret = "tkjz2mu4x1";
OAuth.Manager m = new OAuth.Manager();
m["consumer_key"] = ConsumerKey;
m["consumer_secret"] = ConsumerSecret;
OAuth.OAuthResponse requestToken =
m.AcquireRequestToken("https://openapi.etsy.com/v2/oauth/request_token?scope=transactions_r", "POST");
}
}
}
任何帮助将不胜感激。