![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
.net C#
pwair
这个作者很懒,什么都没留下…
展开
-
C# 播放mp3
using System.Media;WMPLib.WindowsMediaPlayer Wmp = new WMPLib.WindowsMediaPlayer();wmp.settings.setMode("loop", true);wmp.URL = PropertyFileOperator.GetWavePath("test.mp3");wmp.settings.volume = 100;wmp.controls.play(); 需要导入C:/Windows/System32/wm原创 2010-11-23 10:42:00 · 791 阅读 · 0 评论 -
C# 文件夹操作若干
public static bool IsUsed(String fileName) { bool result = false; try { FileStream fs = File.OpenWrite(fileName); fs.Close(); } c原创 2010-11-23 11:04:00 · 768 阅读 · 0 评论 -
C# 窗体不显示最大化等按钮
public void CreateMyBorderlessWindow() { this.FormBorderStyle = FormBorderStyle.None; this.MaximizeBox = false; this.MinimizeBox = false; this.StartPosition = FormStartPosition.CenterScreen; // Remove the control box so the原创 2010-11-23 10:38:00 · 3265 阅读 · 0 评论 -
C# 设置控件的背景图片
this.btnNext.BackgroundImage = System.Drawing.Image.FromFile("图片路径");原创 2010-11-23 11:18:00 · 1453 阅读 · 0 评论 -
C# 无边框按钮,获得焦点时也没有框
无边框设定,在XXX.Designer.cs中: this.btnNext.FlatAppearance.BorderColor = System.Drawing.Color.White; this.btnNext.FlatAppearance.BorderSize = 0; this.btnNext.FlatAppearance.CheckedBackColor = System.Drawing.Color.White;原创 2010-11-23 11:25:00 · 7197 阅读 · 4 评论 -
C# 捕获USB插入,拔出事件
public const int WM_DEVICECHANGE = 0x219; public const int DBT_DEVICEARRIVAL = 0x8000; public const int DBT_DEVICEREMOVECOMPLETE = 0x8004; protected override void WndProc(ref Message m) {原创 2010-11-23 10:54:00 · 6492 阅读 · 1 评论 -
C# 设置鼠标位置
[System.Runtime.InteropServices.DllImport("user32.dll")] public static extern int SetCursorPos(int x, int y); public setMousePos() { SetCursorPos(1, 1); }原创 2010-11-23 11:15:00 · 1534 阅读 · 0 评论 -
C# 将自己写的方法添加到系统事件中
<br />在Designer.cs中<br />this.btnNext.Click += new System.EventHandler(this.button1_Click);原创 2010-11-23 11:30:00 · 797 阅读 · 0 评论