我已经编写了以下代码来获取CRM的令牌.
class Program
{
private const string username = "richa@azuretraining112.onmicrosoft.com";
private const string password = "Pa$$w0rd";
private const string serviceURL = "https://azuretraining112.crm8.dynamics.com";
private const string applicationID = "89a70b76-3a71-481f-8755-a7aa97c59c35";
private const string redirectURL = "https://localhost1";
private const string authorityURI = "https://login.microsoftonline.com/1d54ea41-cd25-488f-812c-c078e6114065/oauth2/authorize";
private static AuthenticationResult authResult = null;
private static void Main(string[] args)
{
var credentials = new UserPasswordCredential(username, password);
var context = new AuthenticationContext(authorityURI);
authResult = context.AcquireTokenAsync(serviceURL, applicationID, credentials).Result;
}
}
Run Code Online (Sandbox Code Playgroud)
但是,在运行代码时,我在尝试使用AcquireTokenAsync获取令牌时收到以下错误.
我不知道我错过了什么.请帮忙!
我尝试了租户未授权的解决方案,但没有任何效果.
谢谢!
我编写了一个基本的客户端服务器代码来了解TCP状态.客户代码:
#include <stdio.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <string.h>
int main(){
int clientSocket;
char buffer[1024];
struct sockaddr_in serverAddr;
socklen_t addr_size;
/*---- Create the socket. The three arguments are: ----*/
/* 1) Internet domain 2) Stream socket 3) Default protocol (TCP in this case) */
clientSocket = socket(PF_INET, SOCK_STREAM, 0);
/*---- Configure settings of the server address struct ----*/
/* Address family = Internet */
serverAddr.sin_family = AF_INET;
/* Set port number, using htons function to use proper byte order */ …Run Code Online (Sandbox Code Playgroud) 我写的程序如下:
#include<cstdio>
#define max(a,b) a>b?a:b
using namespace std;
int main()
{
int sum=0,i,k;
for(i=0;i<5;i++)
{
sum=sum+max(i,3);
}
printf("%d\n",sum);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我得到了输出:4
但当我存储max(i,3在一个变量k然后添加到sum,我得到了正确的输出:
#include<cstdio>
#define max(a,b) a>b?a:b
using namespace std;
int main()
{
int sum=0,i,k;
for(i=0;i<5;i++)
{
k=max(i,3);
sum=sum+k;
}
printf("%d\n",sum);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
产量:16
有人可以解释为什么会这样吗?
我试图从Bootloader编写引导加载程序。写的代码是
BITS 16
start:
mov ax, 07C0h ; Set up 4K stack space after this bootloader
add ax, 288 ; (4096 + 512) / 16 bytes per paragraph
mov ss, ax
mov sp, 4096
mov ax, 07C0h ; Set data segment to where we're loaded
mov ds, ax
mov si, text_string ; Put string position into SI
call print_string ; Call our string-printing routine
jmp $ ; Jump here - infinite loop!
text_string db 'This is my cool …Run Code Online (Sandbox Code Playgroud) 我是android编程的新手.我想制作一款带有抽认卡的应用.这些抽认卡会有单词,当我触摸它们时,它会转向显示单词的含义.
我搜索谷歌.但我找不到任何制作抽认卡的正确教程.
谢谢!
代码是:
#include<stdio.h>
int main()
{
char *st1="hello";
char *st2="hello";
if(st1==st2)
printf("equal %u %u",st1,st2);
else
printf("unequal");
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我得到输出"相等4206628 4206628".
在以下代码中:
#include<cstdio>
#define max(a,b) (a>b?a:b)
using namespace std;
int main()
{
int f=10000000;
long long i=(long long)max(1000000,f*f);
printf("%lld",i);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我得到了输出
276447232
但如果我写
long long i=max((long long)1000000,(long long)f*f);
Run Code Online (Sandbox Code Playgroud)
我得到了输出
百兆
这两条线有什么区别?为什么在第一种情况下不会发生类型转换?