This topic provides the download URL of the .NET SDK package that is required for you to use RAM. This topic also describes how to use the RAM SDK for .NET.

Download URL

You can download the SDK package from the following link: SDK for .NET.

Note The RAM SDK package has been uploaded to NuGet. For more information, visit the NuGet website.

Use the RAM SDK for .NET

The section describes how to create a RAM user by using the RAM SDK for .NET.

using System;
using Aliyun.Acs.Core;
using Aliyun.Acs.Core.Profile;
using Aliyun.Acs.Ram.Model.V20150501;

namespace ram_net_sdk_sample
{
    class Program
    {
        static void Main(string[] args)
        {
            //Construct an Alibaba Cloud client. The client will be used to send a request.
            // When you construct the client, set the AccessKey ID and AccessKey secret.
            // RAM is a global service. Its API endpoint is located in the China (Hangzhou) region. Therefore, specify cn-hangzhou.
            IClientProfile profile = DefaultProfile.GetProfile("cn-hangzhou", "<access-key-id>", "<access-key-secret>");
            DefaultAcsClient client = new DefaultAcsClient(profile);


            // Construct a CreateUser request.
            CreateUserRequest request = new CreateUserRequest();

            // Specify the UserName parameter.
            request.UserName = "alice";

            // Issue the request and obtain a response.
            try
            {
                CreateUserResponse response = client.GetAcsResponse(request);

                Console.WriteLine("UserName: " + response.User.UserName);
                Console.WriteLine("CreateTime: " + response.User.CreateDate);
            }
            catch (Exception ex)
            {
                Console.Write(ex.ToString());
            }
            Console.ReadLine();
        }

    }
}