Giter VIP home page Giter VIP logo

qcloudapi-sdk-dotnet's Introduction

qcloudapi-sdk-dotnet

qcloudapi-sdk-dotnet是为了让.Net开发者能够在自己的代码里更快捷方便的使用腾讯云的API而开发的SDK工具包。

更新

[3/10] 增加HmacSHA256签名算法的兼容 [7/15] 增加Tdsql模块

资源

入门

  1. 申请安全凭证。 在第一次使用云API之前,用户首先需要在腾讯云网站上申请安全凭证,安全凭证包括 SecretId 和 SecretKey, SecretId 是用于标识 API 调用者的身份,SecretKey是用于加密签名字符串和服务器端验证签名字符串的密钥。SecretKey 必须严格保管,避免泄露。

  2. 下载SDK,放入到您的程序目录。 使用方法请参考下面的例子。

例子

    static void Main(string[] args)
    {
        SortedDictionary<string, object> config = new SortedDictionary<string, object>(StringComparer.Ordinal);
	    config["SecretId"] = "你的secretId";
	    config["SecretKey"] = "你的secretKey";
        config["RequestMethod"] = "GET";
	    config["DefaultRegion"] = "gz";

        QCloudAPIModuleCenter module = new QCloudAPIModuleCenter(new Cvm(), config);
        SortedDictionary<string, object> requestParams = new SortedDictionary<string, object>(StringComparer.Ordinal);
        requestParams["offset"] = 0;
        requestParams["limit"] = 3;
    //在这里指定所用的签名算法,不指定默认为HmacSHA1
    //requestParams["SignatureMethod"] = "HmacSHA256";
        Console.WriteLine(module.GenerateUrl("DescribeInstances", requestParams));
        Console.WriteLine(module.Call("DescribeInstances", requestParams));


        //SortedDictionary<string, object> config = new SortedDictionary<string, object>(StringComparer.Ordinal);
        //config["SecretId"] = "你的secretId";
        //config["SecretKey"] = "你的secretKey";
        //config["RequestMethod"] = "POST";
        //config["DefaultRegion"] = "gz";

        //UploadCdnEntity
        //string fileName = "c:\\del.bat";
        //SortedDictionary<string, object> requestParams = new SortedDictionary<string, object>(StringComparer.Ordinal);
        //requestParams["entityFileName"] = "/upload/del.bat";
        //requestParams["entityFile"] = fileName;
        //QCloudAPIModuleCenter module = new QCloudAPIModuleCenter(new Cdn(), config);
        //Console.WriteLine(module.Call("UploadCdnEntity", requestParams));

        Console.ReadKey();
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.