为什么在这个简单的程序中:
if (request.IsPasswordGrantType())
{
if (!Email_Regex_Validation.Check_Valid_Email_Regex(request.Username))
{
return BadRequest(Resources.RegexEmail);
}
SpLoginUser stored = new SpLoginUser(_context);
string result = stored.Usp_Login_User(request.Username, request.Password);
if (!result.Contains("successfully"))
{
return Forbid(OpenIddictServerDefaults.AuthenticationScheme);
}
// Create a new ClaimsIdentity holding the user identity.
var identity = new ClaimsIdentity(
OpenIddictServerDefaults.AuthenticationScheme,
OpenIdConnectConstants.Claims.Name,
OpenIdConnectConstants.Claims.Role);
identity.AddClaim(Resources.issuer, Resources.secret,
OpenIdConnectConstants.Destinations.IdentityToken);
identity.AddClaim(OpenIdConnectConstants.Claims.Name, request.Username,
OpenIdConnectConstants.Destinations.IdentityToken);
var ticket = new AuthenticationTicket(new ClaimsPrincipal(identity), new AuthenticationProperties(), OpenIdConnectServerDefaults.AuthenticationScheme);
ticket.SetScopes(OpenIdConnectConstants.Scopes.OfflineAccess);
// Ask OpenIddict to generate a new token and return an OAuth2 token response.
return SignIn(ticket.Principal, ticket.Properties, ticket.AuthenticationScheme);
}
按Ctrl + s会挂起吗?
答案 0 :(得分:4)
当您使用initscr
开始诅咒时,终端处于烹饪模式,该模式采用XON / XOFF。在curses手册页中,称为“流控制字符” ; POSIX将其称为“输出控件” :
if (GPBox.IsChecked == true)
{
connect = new MySqlConnection(connectionString);
cmd = new MySqlCommand("select distinct * from gpSurgery", connect);
connect.Open();
DataTable dt = new DataTable();
dt.Load(cmd.ExecuteReader());
connect.Close();
DataGrid1.DataContext = dt;
}
如果您呼叫raw
,则会将XON / XOFF 关闭 关闭,并且可以使用 control IXON
Enable start/stop output control.
:
S
您的应用程序可以调用#include <curses.h>
#include <iostream>
int main() {
initscr();
raw(); // possibly what you intended
keypad(stdscr, TRUE);
timeout(-1);
int c = getch();
std::cout << c << std::endl;
endwin();
}
以确定是否设置了基本的XON / XOFF模式,但这无助于确定curses是否设置了原始模式:
答案 1 :(得分:2)
我相信您遇到了XOFF/XON flow control。 Ctrl S 为XOFF,并停止输出,直到发送 Ctrl Q (XON)。您可能可以通过键入 Ctrl Q 来恢复程序。
这与您的代码无关。这是在终端级别上发生的。