使用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类中加一个时间属性
随机推荐
- Sqoop的安装及常用命令
本次安装主要是为了离线分析数据清洗完成后的操作:网站日志流量分析系统之数据清洗处理(离线分析) 一.概述 1. sqoop是Apache 提供的工具,用于hdfs和关系型数据库之间数据的导入和导入 2 ...
- 操作COOKIE的函数
一个同学慧涛分享给我的他写的操作cookie的函数,贴出来,做个笔记: //操作cookie //删除cookie hcookie('cookiename','','del'); //查询cookie ...
- ubuntu 16 “无法获得锁”解决方案
强制解锁,命令 sudo rm /var/cache/apt/archives/lock sudo rm /var/lib/dpkg/lock
- idea 启动java项目报 java: 程序包org.apache.jasper.tagplugins.jstl.core不存在
File -- Project Structure
- bootstrap与vue,react的区别
链接(与Vue区别):https://www.php.cn/faq/423095.html 链接(BootStrap, React, Vue的比较):https://www.jianshu.com/p ...
- Spring学习(七)
注解产生原因 1.传统spring的做法:使用xml来对bean进行注入和或者是配置aop.事物配置文件体积庞大,造成了配置文件的可读性和可维护性很低Java文件和xml不断切换,造成思维不连贯开发效 ...
- 关于雷达(Radar)信道
有些时候,我们在实际的无线网络中,会遇到无线信道一致flapping的情况,即便我们自定义了信道的,发现也会出现flapping.如果这种情况,可能需要确认是否你使用的信道上检测到了雷达. 这里记录一 ...
- 比较器Comparable Comparator
一. Comparable Comparable 是排序接口,若一个类实现了 Comparable 接口,就意味着该类支持排序.实现了Comparable 接口的类的对象的列表或者数组可以通过 Col ...
- BFS迷宫问题
链接:https://ac.nowcoder.com/acm/challenge/terminal来源:牛客网 小明现在在玩一个游戏,游戏来到了教学关卡,迷宫是一个N*M的矩阵. 小明的起点在地图中用 ...
- SQL mybatis动态查询小结
动态返回mysql某张表指定列的名字 <select id="queryColumns" resultType="map" parameterType=& ...