我找到了一个很有趣的东西 - 让我们说:
enum Myenum { a, b, c= 0 }
public class Program
{
static void Main(string[] args)
{
Myenum ma = Myenum.a;
Console.WriteLine(ma);
}
}
Run Code Online (Sandbox Code Playgroud)
其结果就是一个,为什么?
如果我说:
enum Myenum { a, b=0, c}
public class Program
{
static void Main(string[] args)
{
Myenum ma = Myenum.a;
Console.WriteLine(ma);
}
}
Run Code Online (Sandbox Code Playgroud)
结果变成"b",为什么?
假设我有一个实现IDisposible的结构类型,如果我使用下面的代码:
using (MyStruct ms = new MyStruct())
{
InnerAction(ms); //Notice "InnerAction" is "InnerAction(MyStruct ms)"
}
Run Code Online (Sandbox Code Playgroud)
当然我看到在使用块之后,ms被处理掉了.然而,"InnerAction"中的结构呢?它是否仍然存在,因为深层复制或它也处置?
如果它仍然存活(未处理),我必须使用"ref"作为"InnerAction"吗?
请给我你的证明:)
大家好.
我是DropBox的Api访问的新手(参见:https://www.dropbox.com/developers-v1/core/docs#oauth2-methods).现在有一个问题在震动我 -
1)我成功获得了access_token.2)我想通过直接呼叫" https://api.dropboxapi.com/1/account/info "来查看用户的详细信息.但结果是:
{"error_description": "No auth function available for given request", "error": "invalid_request"}
Run Code Online (Sandbox Code Playgroud)
我似乎应该给地址一些东西,以确保我已经过身份验证.但是怎么样?文件中没有看到任何内容......?在哪里?谢谢