Form1.cs
资源名称:Vib_7500.rar [点击查看]
上传用户:junrenl
上传日期:2022-04-24
资源大小:11k
文件大小:1k
源码类别:
Windows Mobile
开发平台:
C#
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- using System.Runtime.InteropServices;
- using System.Threading;
- namespace Vib
- {
- public partial class Form1 : Form
- {
- public struct NLED_SETTINGS_INFO
- {
- public int LedNum;
- public int OffOnBlink;
- public int TotalCycleTime;
- public int OnTime;
- public int MetacycleOn;
- public int MetacycleOff;
- }
- [DllImport("Coredll.dll")]
- public static extern bool NLedSetDevice(int deviceId, ref NLED_SETTINGS_INFO info);
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- NLED_SETTINGS_INFO info = new NLED_SETTINGS_INFO();
- info.LedNum = 1;
- info.OffOnBlink = 1;
- NLedSetDevice(1, ref info);
- }
- private void button2_Click(object sender, EventArgs e)
- {
- NLED_SETTINGS_INFO info = new NLED_SETTINGS_INFO();
- info.LedNum = 1;
- info.OffOnBlink = 0;
- NLedSetDevice(1, ref info);
- }
- }
- }