基本上,我有一些类调用静态void提供了参数(used in an ASP website).
从我的理解,因为虚空有它自己的堆栈它是线程安全的,但是我不完全确定在使用输出时是否为真.有人可以澄清这个问题.谢谢!
namespace ThreadTest
{
class Program
{
static void Main(string[] args)
{
int helloWorldint = 0;
bool helloWorldbool = false;
int helloWorldintOut = 0;
bool helloWorldboolOut = false;
setHelloWorlds(helloWorldint, helloWorldbool, out helloWorldintOut, out helloWorldboolOut);
Console.WriteLine(helloWorldintOut);
Console.WriteLine(helloWorldboolOut);
}
public static void setHelloWorlds(int helloWorldint, bool helloWorldbool, out int helloWorldintOut, out bool helloWorldboolOut)
{
helloWorldintOut = helloWorldint + 1;
helloWorldboolOut = true;
}
}
}
Run Code Online (Sandbox Code Playgroud) 我有这个简单的 Azure 函数:
public static class MyCounter
{
public static int _timerRound = 0;
public static bool _isFirst = true;
[FunctionName("Counter")]
//[TimeoutAttribute("00:00:05")]
public async static Task Run([TimerTrigger("*/10 * * * * *")]TimerInfo myTimer, TraceWriter log, CancellationToken token)
{
try
{
log.Info($"C# Timer trigger function executed at: {DateTime.UtcNow}");
if (_isFirst)
{
log.Info("Cancellation token registered");
token.Register(async () =>
{
log.Info("Cancellation token requested");
return;
});
_isFirst = false;
}
Interlocked.Increment(ref _timerRound);
for (int i = 0; i < 10; i++)
{
log.Info($"Round: {_timerRound}, …Run Code Online (Sandbox Code Playgroud) 我正在处理一个演出,它是一个 Office (Excel) 2016 加载项,用于与 Web 应用程序进行数据集成。我们使用的是 Office JS API,并且 XML 清单文件指向一个 AngularJS Web 应用程序。一切正常,到目前为止工作正常。
最近,我们决定向 Web 应用程序添加 OAuth2 功能,以便用户可以通过 3rd 方授权服务器进行身份验证。
问题是,一旦我放置了一个链接(<a>标签)或运行 awindow.location.replace()或设置window.location.hrefwhich指向一个主机名而不是清单文件中提到的主机名的 URL,它会在新窗口中打开 URL,而我想要它只是重定向到加载项窗口中的 URL。
有人知道如何解决这个问题吗?
谢谢