.NET 快速开始
准备工作
第 1 步: 开启匿名登录
在环境设置页面中,点击“登录方式”,然后启用匿名登录:

第 2 步:创建 .NET Core 项目
dotnet new console -o Demo
cd Demo
第 3 步:添加 CloudBase Sdk 依赖
dotnet add package TencentCloudBase
第 4 步:初始化环境并调用匿名登录
using System;
using System.Threading.Tasks;
using CloudBase;
namespace Demo {
  class Program {
    static void Main(string[] args) {
      // 初始化 CloudBase
      CloudBaseApp app = CloudBaseApp.Init(
        // 填写您的云开发 env
        "your-env-id",
        // 填写网络请求超时时间
        3000
      );
      // 获取登录状态
      AuthState state = await app.Auth.GetAuthStateAsync();
      // 唤起匿名登录
      if (state == null) {
        state = await app.Auth.SignInAnonymouslyAsync();
      }
    }
  }
}
登录成功后,便可以访问和使用云开发的各类资源,详情请参看 CloudBase SDK 文档