2008-8-7 14:29:14
窗体的show方法,没有给调用代码任何通知,如果需要通知,使用showdialog是一种好的选择。 在调用show方法后,show方法后面的代码会立即执行,调用showdialog方法后,调用代码被暂停执行,等到调用showdialog方法的窗体关系后再继续执行。而且窗体可以返回一个dialogresult值,他描述了窗体关闭的原因,例如OK,Cancel,yes.. |
2008-8-6 21:56:45
/// <summary> /// 打开Excel并将DataGridView控件中数据导出到Excel /// </summary> /// <param name="dgv">DataGridView对象 </param> /// <param name="isShowExcle">是否显示Excel界面 </param> /// <remarks> /// add com "Microsoft Excel 11.0 Object Library" /// using Excel=Microsoft.Office.Interop.Excel; /// </remarks> /// <returns> </returns> |
2008-8-3 18:08:31
<!--■■■■■■■■■■■■■■■■■■■伪静态配置 end■■■■■■■■■■■■■■■■■■■--> <!--System.Configuration.ConfigurationSettings.AppSettings["SocutDataLink"];--> <!--传说中以前.net1.1用这个保存数据库链接,如今可以用这个来保存一些配置--> <appSettings> <add key="SocutDataLink" value="Data/db1.mdb"/> <add key="Domain" value="http://www.yongfa365.com/"/> <add key="Author" value="柳永法,yongfa365"/> </appSettings> <!--System.ConfigurationConfigurationManager |
2008-7-24 20:14:30
3. 适用场合 IIS相关配置:
默认只支持.net格式的重定向 比如:.aspx格式的重定向。 如:show_12_yongfa365.aspx --> show.aspx?id=12&name=yonga365
如果想实现,*.html这样的格式(一般我们就用这种方法实现.net 伪静态) 如:show_12_yongfa365.html --> show.aspx?id=12&name=yonga365 |
2008-7-17 14:34:07
//处理原图片 Graphics g = Graphics.FromImage(image); Font f = new Font("隶书", 16); Brush b = new SolidBrush(ColorTranslator.FromHtml("#FF0000")); string addText = "文字水印内容"; g.DrawString(addText, f, b, 10, 10); g.DrawImageUnscaled(syimage, 50, 50); //g.DrawImage(newimage,50,50,100,100); |
2008-7-15 21:55:45
匹配非“非内容”的行的表达式应该写成:^(?!.*非内容).*$ |
2008-6-16 8:24:45
打开vs2005或vs2008, 新建网站,把ACCCESS数据库Copy到App_Data里, 拖"AccessDataSource"到窗口里, 配置数据源。。。 选择数据库 下一步 sql语句里是空的,点“查询生成器...” 弹出:
--------------------------- Microsoft Visual Studio --------------------------- 未将对象引用.. |
2008-6-11 12:05:48
自2000年6月Microsoft公司发布.NET计划以来,使编程工作在业界中引起了一次划时代的革命。ASP.NET是.NET计划中的一个重要组成部分,其为Web应用程序开发人员提供了许多新特性,这些特性包括已编译的服务器端代码、一种将服务器端逻辑与客户端布局相分离的代码隐藏(code-behind)技术、可扩展的服务器端控件模型、设计数.. |
2008-5-21 10:48:40
1. 把Setup\setup.sdb文件中的 [Product Key] T2CRQGDKBVW7KJR8C6CKXMW3D 改成 [Product Key] PYHYPWXB3BB2CCMV9DX9VDY8T 2.安装完成后,在“控制面板”中启动“添加删除程序”,选中Vs2008,点击“更改、删除”, 输入序列号:PYHYP-WXB3B-B2CCM-V9DX9-VDY8T 注: 以上序列号为.. |
2008-4-23 20:53:17
XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load("bookstore.xml"); //xmlDoc.LoadXml(""); XmlNode root = xmlDoc.SelectSingleNode("bookstore");//查找 XmlElement xe1 = xmlDoc.CreateElement("book");//创建一个节点 xe1.SetAttribute("genre", "李赞红");//设置该节点genre属性 xe1.SetAttribute("ISBN", "2-3631-4");//设置该节点ISBN属性
XmlElement xesub1 = xmlDoc.CreateElement("title"); xesub1.InnerText = "CS从入门到精通";//设置文本节点 xe1.AppendChild(xesub1);//添加到节点中 XmlElement xesub2 = xmlDoc.CreateElement("author"); xesub2.InnerText = "候捷"; xe1.AppendChild(xesub2);
XmlElement xesub3 = xmlDoc.CreateElement("price"); xesub3.InnerText = "58.3"; xe1.AppendChild(xesub3);
root.AppendChild(xe1);//添加到节点中 xmlDoc.Save("bookstore.xml"); |
2008-4-23 13:31:55
string str=""; str += "\r\n" + System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName; str += "\r\n" + System.Environment.CurrentDirectory; str += "\r\n" + System.IO.Directory.GetCurrentDirectory(); str += "\r\n" + System.AppDomain.CurrentDomain.BaseDirectory; str += "\r\n" + System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase; str += "\r\n" + System.Windows.Forms.Application.StartupPath; str += "\r\n" + System.Windows.Forms.Application.ExecutablePath; Console.Write(str); Console.ReadKey(); |
2008-4-23 10:03:15
第一种方法: string s=abcdeabcdeabcde; string[] sArray=s.Split('c') ; foreach(string i in sArray) Console.WriteLine(i.ToString()); 输出下面的结果: ab deab deab de 第二种方法: 我们看到了结果是以一个指定的字符进行的分割。使用另一种构造方法对多个字符进行分割: string s="abcdeabcdeabcde".. |
2008-4-18 16:19:26
//服务器重启服务,作者:柳永法 www.yongfa365.com using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.ServiceProcess; using System.IO; using System.Text; using System.Timers; |
2008-4-18 15:51:52
using System; using System.Collections.Generic;
//int[]到string[]的转换 public class Example { static void Main() { int[] int_array = { 1, 2, 3 };
string[] str_array = Array.ConvertAll(int_array, new Converter<int, string>(IntToString));
foreach (string s in str_array) { Console.WriteLine(s); } Console.Read(); }
public static string IntToString(int i) { return i.ToString(); } } |
2008-4-18 15:22:26
//演示
using System; using System.Collections.Generic; using System.Text; using System.Collections;
namespace 生成N个不重复随机数的两个函数 { class Program { static void Main(string[] args) { DateTime d1 = System.DateTime.Now; int[].. |
|
|
| |
文章分类 |
|
|
|