使用c#调用API入门
|
Win32 Types
|
Specification
|
CLR Type
|
|
char, INT8, SBYTE, CHARâ€
|
8-bit signed integer
|
System.SByte
|
|
short, short int, INT16, SHORT
|
16-bit signed integer
|
System.Int16
|
|
int, long, long int, INT32, LONG32, BOOL†, INT
|
32-bit signed integer
|
System.Int32
|
|
__int64, INT64, LONGLONG
|
64-bit signed integer
|
System.Int64
|
|
unsigned char, UINT8, UCHAR†, BYTE
|
8-bit unsigned integer
|
System.Byte
|
|
unsigned short, UINT16, USHORT, WORD, ATOM, WCHAR†, __wchar_t
|
16-bit unsigned integer
|
System.UInt16
|
|
unsigned, unsigned int, UINT32, ULONG32, DWORD32, ULONG, DWORD, UINT
|
32-bit unsigned integer
|
System.UInt32
|
|
unsigned __int64, UINT64, DWORDLONG, ULONGLONG
|
64-bit unsigned integer
|
System.UInt64
|
|
float, FLOAT
|
Single-precision floating point
|
System.Single
|
|
double, long double, DOUBLE
|
Double-precision floating point
|
System.Double
|
|
†In Win32 this type is an integer with a specially assigned meaning; in contrast, the CLR provides a specific type devoted to this meaning.
|
||

using System;
using System.Runtime.InteropServices;
public class MSSQL_ServerHandler
{
[DllImport("kernel32.dll")]
public static extern int GetShortPathName
(
string path,
StringBuilder shortPath,
int shortPathLength
)
}


using System;
using System.Runtime.InteropServices;
public class MSSQL_ServerHandler
{
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
public static extern int GetShortPathName
(
[MarshalAs(UnmanagedType.LPTStr)] string path,
[MarshalAs(UnmanagedType.LPTStr)] StringBuilder shortPath,
int shortPathLength
)
}

[DllImport("kernel32.dll", EntryPoint="getShort")]
[DllImport] 虽等效于 [DllImportAttribute],但 DllImportAttribute 才是该属性在 .NET Framework 中的实际名称。本文出自 “锉人Kris” 博客,请务必保留此出处http://chris.blog.51cto.com/112473/29285
使用c#调用API入门的更多相关文章
- 阿里云API网关(3)快速入门(调用 API)
网关指南: https://help.aliyun.com/document_detail/29487.html?spm=5176.doc48835.6.550.23Oqbl 网关控制台: https ...
- Web API 入门指南 - 闲话安全
Web API入门指南有些朋友回复问了些安全方面的问题,安全方面可以写的东西实在太多了,这里尽量围绕着Web API的安全性来展开,介绍一些安全的基本概念,常见安全隐患.相关的防御技巧以及Web AP ...
- 转载-Web API 入门
An Introduction to ASP.NET Web API 目前感觉最好的Web API入门教程 HTTP状态码 Web API 强势入门指南 Install Mongodb Getting ...
- Hadoop MapReduce编程 API入门系列之压缩和计数器(三十)
不多说,直接上代码. Hadoop MapReduce编程 API入门系列之小文件合并(二十九) 生成的结果,作为输入源. 代码 package zhouls.bigdata.myMapReduce. ...
- Web API入门指南(安全)转
安全检测的工具站点:https://www.owasp.org/index.php/Category:Vulnerability_Scanning_Tools Web API入门指南有些朋友回复问了些 ...
- C#区域截图——调用API截图
原文:C#区域截图——调用API截图 前言:截图对于一个C++开发者来说无非是小菜一碟,也有朋友使用C#的 Graphics.CopyFromScreen 方法屏幕操作,作为一名整天想着用 C++ 开 ...
- Web API 入门指南
Web API 入门指南 - 闲话安全2013-09-21 18:56 by 微软互联网开发支持, 231 阅读, 3 评论, 收藏, 编辑 Web API入门指南有些朋友回复问了些安全方面的问题,安 ...
- 阿里云API网关(5)用户指南(调用 API)
网关指南: https://help.aliyun.com/document_detail/29487.html?spm=5176.doc48835.6.550.23Oqbl 网关控制台: https ...
- Web API 入门 二 媒体类型
还是拿上面 那篇 Web API 入门 一 的那个来讲 在product类中加一个时间属性
随机推荐
- python、js实现WGS84、高德(火星)、百度坐标转换
在日常工作学习中常会涉及到WGS84.高德(火星/谷歌).百度三种空间坐标系的坐标转换,本文将通过python.js两种语言实现坐标系的转换. 坐标系说明: wgs84:为一种大地坐标系,也是目前广泛 ...
- 总结 jion,group join 基于方法的查询与查询表达式 对比
数据源: 代码: using (tempdbEntities context = new tempdbEntities()) { #region 基于方法的查询 Console.WriteLine(& ...
- 转:建立maven私服
一.下载安装与配置 下载 到官网下载:https://www.sonatype.com/download-oss-sonatype image.png 下载的是oss3.x版本的(当时最新版), ...
- Flask, Django - 区别,个人体会
1. 目录结构 一般情况下,Django很系统.统一.Flask项目目录风格不同一,即使用上了蓝图. 2. 数据库迁移 Flask要用第三方extensions,而Django自带,这个很方便. 3. ...
- Fluent_Python_Part4面向对象,08-ob-ref,对象引用、可变性和垃圾回收
第四部分第8章,对象引用.可变性和垃圾回收 1. 创建对象之后才会把变量分配给对象 变量是对象的标注,是对象的别名,是对象的引用,并不是对象存储的地方. 例子1. 证明赋值语句的右边先执行 class ...
- 「题解」「2014 NOI模拟赛 Day7」冒泡排序
目录 题目 考场思考 正解 题目勾起了我对我蒟蒻时代的回忆,虽然我现在也蒟蒻 题目 点这里 可能链接会挂,在网上搜题目就有. 毕竟 \(BZOJ\) 有点老了... 考场思考 本来以为十分友善的一道题 ...
- 《Airbnb 早期BP》---创业学习--训练营直播第3课--HHR
1,Airbnb:300亿美金. 一,BP 价值: 1,优秀的BP原则: (1)UCD原则:user centered design,用户为中心的设计.站在投资人视角,回答最关心的问题. (2)清晰原 ...
- mysql修改字符集为utf8
https://zhidao.baidu.com/question/1642165712897935220.html
- USER 指定当前用户,希望以某个已经建立好的用户来运行某个服务进程,不要使用 su 或者 sudo,这些都需要比较麻烦的配置,而且在 TTY 缺失的环境下经常出错。建议使用 gosu
USER 指定当前用户 格式:USER <用户名>[:<用户组>] USER 指令和 WORKDIR 相似,都是改变环境状态并影响以后的层.WORKDIR 是改变工作目录,US ...
- 在java的静态方法中访问类的实例成员
直接来看代码: public class Example { int x = 3;//类的实例变量,初始化值为3 static int y = 4;//类的静态变量,初始化值为4 public sta ...