GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - QcloudApi/qcloudapi-sdk-dotnet

BranchesTags
Open more actions menu

Latest commit

 

History

60 Commits
60 Commits

Folders and files

NameName
Last commit message
Last commit date
QCloudAPI_SDK
QCloudAPI_SDK
 
 
.gitignore
.gitignore
 
 
CHANGELOG.rst
CHANGELOG.rst
 
 
README.md
README.md
 
 

Repository files navigation

qcloudapi-sdk-dotnet

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

资源

  • 公共参数
  • API列表
  • 错误码

入门

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

  2. 下载SDK,放入到您的程序目录。

为了保障您能使用到最新的源代码,推荐您选择以下两种方法之一:

  • 使用git拉取代码到本地:git clone https://github.com/QcloudApi/qcloudapi-sdk-dotnet
  • 直接下载 https://github.com/QcloudApi/qcloudapi-sdk-dotnet/archive/master.zip ,以使用7-zip解压缩为例,选择"提取到当前位置",然后将qcloudapi-sdk-dotnet-master文件夹重命名为qcloudapi-sdk-dotnet

以Microsoft Visual C# 2010 Express作为例子,您可以选择以下两种方法之一调用SDK:

  • 直接引用项目,步骤如下:
    1. 在解决方案中选择添加已有项目。选择File -> Add -> Existing Project...,浏览到刚才下载的代码路径下,打开QCloudAPI_SDK目录,再打开QCloudAPI_SDK目录,选择QCloudAPI_SDK.csproj文件,确定。
    2. 在解决方案中引用该项目。在Solution Explorer中选中您的解决方案,右键选择Add Reference...,选择Projects标签页,选择QCloudAPI_SDK,确定
  • 引用DLL,步骤如下:
    1. 打开QCloudAPI_SDK解决方案。选择File -> Open Project...,浏览到刚才下载的代码路径下,打开QCloudAPI_SDK目录,选择QCloudAPI_SDK.sln文件,确定
    2. 生成DLL。在Solution Explorer中选中QCloudAPI_SDK解决方案,右键选择Build。
    3. 引用DLL。切换到您的解决方案,在Solution Explorer中选中您的解决方案,邮件选择Add Reference...,选择Browser标签页,浏览到刚才下载的代码路径下,打开QCloudAPI_SDK目录,再打开QCloudAPI_SDK目录,选择bin目录,选择Debug目录,选择QCloudAPI_SDK.dll,确定

其他IDE环境请参照例子酌情处理。

具体使用方法请参考下面的例子。

例子

    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();
    }

About

No description, website, or topics provided.

Resources

Readme
Activity

Stars

26 stars

Watchers

9 watching

Forks

32 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.