随笔分类 -  .Net

1 2 下一页

C#如何判断程序调用的exe已结束
摘要:二个方法:以运行系统记事本为例方法一:这种方法会阻塞当前进程,直到运行的外部程序退出System.Diagnostics.Process exep = System.Diagnostics.Process.Start(@"C:\Windows\Notepad.exe");exep.WaitForEx... 阅读全文

posted @ 2015-10-26 09:51 Hai_阔天空 阅读(724) 评论(0) 推荐(0)

c# 计算文字高度
摘要:SizeF sizeF = g.MeasureString(listBox1.Items[e.Index].ToString(), e.Font, listBox1.Width); 阅读全文

posted @ 2015-10-13 13:34 Hai_阔天空 阅读(1016) 评论(0) 推荐(0)

asp 中创建日志打印文件夹
摘要:string FilePath = HttpRuntime.BinDirectory.ToString(); string FileName = FilePath + "日志" + "\\" + System.DateTime.Now.ToString("yyyyMMdd") + ".txt"; //判断有无当天txt文档,没有则创建 if (!File.Exists(FileName)) { //... 阅读全文

posted @ 2013-11-08 11:46 Hai_阔天空 阅读(244) 评论(0) 推荐(0)

.net asp 在1.asp页面嵌入另一个页面2.asp
摘要: 阅读全文

posted @ 2013-09-10 13:59 Hai_阔天空 阅读(218) 评论(0) 推荐(0)

.net asp [转载]ASP:循环滚动图片的代码+解释
摘要:无标题文档 李开复 阅读全文

posted @ 2013-09-10 12:03 Hai_阔天空 阅读(759) 评论(0) 推荐(0)

.net Asp AdRotator(广告控件)
摘要:1.新建项目名称AdRotator2.右键项目名称添加一个xml文件命名为AdRotator.xml images/1.jpg http://www.Microsoft.com 图像不用时显示的文本 可用于筛选特定的广告的广告类别 1000 200 1000 images/2.jpg http://www.asp.net 图像不用时显示的文本 可用于筛选特定的广告的广告类别 300 200 1000 3.新建一个Images文件夹,添加三张图片4.在页面中拖一个AdRotator控件,并设置他的属... 阅读全文

posted @ 2013-09-06 14:59 Hai_阔天空 阅读(572) 评论(0) 推荐(0)

.net asp iis服务器如何让外部访问自己的网站
摘要:1.控制面板-防火墙-高级设置-入站规则-右侧的BranchCache内容检索,右键启用规则。 阅读全文

posted @ 2013-09-06 09:15 Hai_阔天空 阅读(306) 评论(0) 推荐(0)

c# 给button添加不规则的图片以及用pictureBox替代button响应点击事件
摘要:1.Flat button用这个方法,前提是要把button的type设置为Flatbutton1.TabStop = false;button1.FlatAppearance.BorderSize = 0;button1.FlatAppearance.BorderColor = Color.FromArgb(0, 255, 255, 255); //设置边框的颜色Transparentbutton1.FlatAppearance.MouseOverBackColor = Color.FromArgb(0, 255, 255, 255); //设置鼠标经过时候的背景颜色Transparentb 阅读全文

posted @ 2013-09-05 12:05 Hai_阔天空 阅读(1820) 评论(1) 推荐(0)

c# Graphics.DrawImage 方法
摘要:http://msdn.microsoft.com/zh-cn/library/system.drawing.graphics.drawimage.aspx 阅读全文

posted @ 2013-09-04 15:44 Hai_阔天空 阅读(1649) 评论(0) 推荐(0)

c# 执行 CreateHandle() 时无法调用值 Dispose()
摘要:在多线程C#开发中,遇到错误 执行 CreateHandle() 时无法调用值 Dispose()。,这个错误是在关闭窗体的时候出来的。 原因是因为窗体还存在CreateHandle()事件,所以还不能回收垃圾。 当前窗体的句柄Handle还没有创建完成所以不能直接进行关闭操作。解决方法:1.protected override void OnVisibleChanged(EventArgs e){ base.OnVisibleChanged(e); if ( !IsHandleCreated) { this.Close(); }}2.IsB... 阅读全文

posted @ 2013-09-04 15:38 Hai_阔天空 阅读(5774) 评论(0) 推荐(0)

c# Use NAudio Library to Convert MP3 audio into WAV audio(将Mp3格式转换成Wav格式)
摘要:Have you been in need of converting mp3 audios to wav audios? If so, the skill in this article provides you a chance to manage the mp3-to-wav conversion by yourself.The wave audio files are useful because they retain the first-generation archived file with high quality and simple file structures. Bu 阅读全文

posted @ 2013-09-02 14:24 Hai_阔天空 阅读(8329) 评论(0) 推荐(0)

c# WinForm 边框阴影窗体
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Runtime.InteropServices;namespace testWinForm{ public partial class Form2 : Form { public Form2() ... 阅读全文

posted @ 2013-08-29 09:40 Hai_阔天空 阅读(1072) 评论(0) 推荐(0)

c# Socket通信基础
摘要:一、IP地址操作类1、IPAddress类a、在该类中有一个Parse()方法,可以把点分的十进制IP表示转化成IPAddress类,方法如下: IPAddressaddress=IPAddress.Parse(“192.168.0.1”);b、IPAddress提供4个只读字段Any用于代表本地系统可用的任何IP地址Broadcase用于代表本地网络的IP广播地址Loopback用于代表系统的回送地址 None用于代表系统上没有网络接口其中IPAddress.Any最常用可以用来表示本机上所有的IP地址,这对于socket服务进行侦听时,最方便使用,不用对每个IP进行侦听了。而IPAddre 阅读全文

posted @ 2013-08-21 13:04 Hai_阔天空 阅读(286) 评论(0) 推荐(0)

c# Sockect 通信
摘要:1.Serverusing System;using System.Collections.Generic;using System.Text;//添加Socket类using System.Net;using System.Net.Sockets;namespace ScoketServer{ class Program { static void Main(string[] args) { int port = 8080; string host = "17.1.1.78"; //创建... 阅读全文

posted @ 2013-08-20 15:34 Hai_阔天空 阅读(360) 评论(0) 推荐(1)

c# winform窗体边框风格的设计
摘要:1.首先,窗体的FormBorderStyle设置成None,不要控制边框。2.然后,TransparencyKey和BackColor颜色设置成相同的,这样,窗体就透明了。3.最后,窗体的拖动private void pictureBox1_MouseMove(object sender, MouseEventArgs e){ if (e.Button == MouseButtons.Left) { this.Left += e.Location.X - this.oldX; //新的鼠标位置 t... 阅读全文

posted @ 2013-07-01 15:43 Hai_阔天空 阅读(3479) 评论(0) 推荐(0)

c# SQL Server数据库操作-数据适配器类:SqlDataAdapter
摘要:SqlDataAdapter类主要在MSSQL与DataSet之间执行数据传输工具,本节将介绍如何使用SqlDataAdapter类来填充DataSet和MSSQL执行新增、修改。、删除等操作。功能说明 SqlDataAdapter类构建在SqlCommand类之上,并提供了许多配合DataSet使用的功能。使用Fill方法可以把从MSSQL得到的查询结果填充到DataSet中。当DataSet中的数据发生了改变时,使用Update方法可以把更改后的数据更新到MSSQL。语法定义 下面演示如何创建一个SqlDataAdapter类的实例: //无参数 SqlDataAdapter adapt. 阅读全文

posted @ 2013-07-01 11:46 Hai_阔天空 阅读(938) 评论(0) 推荐(0)

c# SQL Server数据库操作-管理命令参数的类:SqlParameter
摘要:使用SqlCommand类来执行Transact-SQL语句或存储过程时,有时需要用参数传值或作为返回值,SqlParameter类正是为了此需要而设计的类。下面介绍如何使用该类为SqlCommand对象设置参数。功能说明 SqlParameter类用来作为SqlCommand类的参数。通过指定参数的ParameterName属性可以设置参数的名称,在使用SqlParameter对象之前必须设置此属性。DbType属性可以指定参数的类型。SqlParameter对象还可以作为存储过程的参数返回结果。语法定义 SqlParameter类的语法定义如下 public sealed class S. 阅读全文

posted @ 2013-07-01 11:07 Hai_阔天空 阅读(786) 评论(0) 推荐(0)

c# comboBox与数据库中的数据绑定
摘要:private void comBoxBinding() { SqlConnection connection = this.getConnection(); connection.Open(); SqlCommand command = new System.Data.SqlClient.SqlCommand(); command = new SqlCommand("select State_Name_English,State_Name,StandSys,StandSys_English,... 阅读全文

posted @ 2013-06-26 13:35 Hai_阔天空 阅读(1082) 评论(0) 推荐(0)

c# Winform间的页面传值
摘要:Form2public partial class Form2 : Form{ public string str; public Form2() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { str = textBox1.Text; Form3 f3 = new Form3(); f3.ShowDialog(this); }}Form3public partial class... 阅读全文

posted @ 2013-06-21 18:02 Hai_阔天空 阅读(223) 评论(0) 推荐(0)

c# 数据库数据与DataGridView表控件的绑定
摘要:public Form1(){ InitializeComponent(); //连接数据库 string str = "Data Source=IP;Initial Catalog=数据库名称;Persist Security Info=True;User ID=**; Password="; ConnectDatebase(str); }void ConnectDatebase(string sql){ SqlConnection connection = new SqlConnection(); connection.ConnectionString = sql;.. 阅读全文

posted @ 2013-06-21 10:56 Hai_阔天空 阅读(904) 评论(0) 推荐(0)

1 2 下一页

导航