所以我按照这里的步骤来写信:https : //www.reddit.com/r/algorading/comments/c81vzq/td_ameritrade_api_access_2019_guide/以获得刷新令牌,以便我可以在 C# 中构建客户端应用程序使用德美利证券的 API,进行特殊股票和期权筛选和交易。在遇到任何麻烦之前,我已经走到了尽头。
在获取我的刷新令牌的最后一步中,您填写了https://developer.tdameritrade.com/authentication/apis/post/token-0上的字段,它失败了,我只是在 HTTP 中得到以下响应401错误:
HTTP/1.1 401 Unauthorized
Access-Control-Allow-Headers: origin
Access-Control-Allow-Methods:
GET
Access-Control-Allow-Origin:
https://developer.tdameritrade.com
Access-Control-Max-Age: 3628800
Cache-Control: no-cache
Connection: keep-alive
Content-Length: 31
Content-Security-Policy: frame-ancestors 'self'
Content-Type: application/json;charset=UTF-8
Date: Sat, 04 Apr 2020 16:07:04 GMT
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Application-Context: OAUTH_SERVICE:run:8080
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block
{
"error": "invalid_grant"
}
Run Code Online (Sandbox Code Playgroud)
可能是什么问题?我已经对每个步骤和文本框中的值(如下图)进行了两次和三次检查以接收刷新令牌,但我无法让它工作。根据指南的步骤,代码和客户端 ID 也已正确完成 - 我进行了两次和三次检查。
我按照 Reddit 指南中的步骤以及 TDA Ameritrade 自己的链接指南进行操作,以确保我将正确的值放在正确的字段中,所以我真的不知道发生了什么。
任何帮助表示赞赏。
我正在尝试动态地将图片框添加到C#win32表单中,以用于我正在尝试构建的接近生产质量的应用程序,而且我已经将它完全降低了.
我遇到的问题是,我似乎无法在方法中动态地将图片框或控件添加到表单中.我已经通过Form1初始化方法将它们添加到表单中,但是如果我在一个button_click方法中添加控件,除非我有一个面板容器,否则它根本不添加它们,并输入panel1.Controls.Add(stuff) .但是,然后图片框出现在与预期完全不同的位置 - 并且显然是由面板本身阻挡的.大多数图片框被面板阻挡,其中一部分是面板外面的.我不知道是怎么回事.
这是我正在使用的代码,我通过按钮点击方法在线学习添加图片框:
PictureBox pb = new PictureBox();
pb.Size = new Size(this.Size.Width / 14, this.Size.Width / 12); //I use this picturebox simply to debug and see if I can create a single picturebox, and that way I can tell if something goes wrong with my array of pictureboxes. Thus far however, neither are working.
pb.BackgroundImage = Properties.Resources.cardback;
pb.BackgroundImageLayout = ImageLayout.Stretch;
pb.Location = new Point(50, 50);
pb.Anchor = AnchorStyles.Left;
pb.Visible = true;
InitializeComponent();
this.Controls.Add(pb);
PictureBox[] pbName = new …Run Code Online (Sandbox Code Playgroud) 我正在制作一个用WPF和Async/Await进行多线程练习的程序,该程序的作用是:
代码如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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 WPF_Asynch_Project
{
public partial class MainWindow : Window
{
public int ClickAmount = 0;
public MainWindow()
{
InitializeComponent();
DelegationIsAwesome();
}
private void Test_Click(object sender, RoutedEventArgs e)
{
ClickAmount++;
MessageBox.Show("You clicked me " + ClickAmount.ToString() + " times!");
}
private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
{
} …Run Code Online (Sandbox Code Playgroud) c# ×2
.net ×1
api ×1
async-await ×1
asynchronous ×1
oauth ×1
oauth-2.0 ×1
trading ×1
winforms ×1
wpf ×1