C# API操作实例
时间:2022-07-23
本文章向大家介绍C# API操作实例,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
/*c#在调用c++方法或者window api时不能象调用c#本身写的dll类库那样直接通过引用dll就可以调用相应的方法, 而是要把要引用的dll放到bin中,现通过[DllImport("User32.dll")]引用*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace API
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
[DllImport("User32.dll")]
public static extern int MessageBoxA(int h, string m, string c, int type);
[DllImport("User32.dll")]
public static extern int MessageBox(int h, string m, string c, int type);
[DllImport("User32.dll")]
public static extern int GetDoubleClickTime();
// public static extern int SendMessageA(int h, int m, int c, int type);
private void button1_Click(object sender, EventArgs e)
{
MessageBoxA(0, "API Message Box", "API Demo", 0);
MessageBox(0, "API Message Box", "API Demo", 0);
MessageBox(0,GetDoubleClickTime().ToString(), "API Demo", 0);
System.Windows.Forms.MessageBox.Show("111");
// SendMessageA(0, 11, 22, 0);
}
}
}
- 代码也疯狂:diagram生成流程图
- 设置你的Gravatar头像的方法
- 阅读Ext 学习Javascript(二)Core/Ext.extend 从继承说起
- IronPython资料
- WordPress免插件仅代码实现“返回顶部、返回底部、评论”效果(样式一)
- encodeURIcomponent编码和ASP.NET之间编码转换
- WordPress免插件仅修改代码去掉评论/留言里的链接
- 阅读Ext 学习Javascript(一)Core/Ext.js
- 利用腾讯的ip地址库做ip地址定位
- WordPress登陆不了后台的原因及解决方法(登陆界面不断返回)
- select元素的options.add 与 insertbefore的区别
- 如何去理解 拓扑排序算法
- WordPress免插件仅代码实现文章归档(模板页面)I
- Bing Map App 开发 还没入门遇见错误无法继续
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法
- spring-boot-route(二):读取配置文件的几种方式
- 关于tensorflow softmax函数用法解析
- keras的backend 设置 tensorflow,theano操作
- spring-boot-route(三)实现多文件上传
- PHP attributes()函数讲解
- PHP children()函数讲解
- spring-boot-route(四)全局异常处理
- PHP registerXPathNamespace()函数讲解
- Python闭包装饰器使用方法汇总
- spring-boot-route(五)整合Swaager2生成接口文档
- spring-boot-route(六)整合JApiDocs生成接口文档
- Python unittest基本使用方法代码实例
- spring-boot-route(七)整合jdbcTemplate操作数据库
- Pytorch 卷积中的 Input Shape用法
- 解决TensorFlow程序无限制占用GPU的方法