摘要:相关参考: http://www.connectionstrings.com/
阅读全文
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->using System; using System.Collections.Generic; using System.Text; using System.IO; namespace MyHash ...
阅读全文
摘要:1、判定一个给定的路径是否有效,合法 通过Path.GetInvalidPathChars或Path.GetInvalidFileNameChars方法获得非法的路径/文件名字符,可以根据它来判断路径中是否包含非法字符; 2、如何确定一个路径字符串是表示目录还是文件 使用Directory.Exists或File.Exist方法,如果前者为真,则路径表示目录;如果后者为真,则路径表示文件...
阅读全文
摘要:HttpWebRequest web = (HttpWebRequest)WebRequest.Create(url); web.AddRange(100);//此方法设置Range值 可以直接使用GetResponseStream方法读取返回数据。服务器响应的消息已被HttpWebReqeust格式化过了。
阅读全文
摘要:I've been embedding the IE component in Windows.Forms apps for some time now but need to do it fairly infrequently. Each time I have to start a new project, I always forget how to add references in m...
阅读全文
摘要:int a = 12345678; //格式为sring输出 // Label1.Text = string.Format("asdfadsf{0}adsfasdf",a); // Label2.Text = "asdfadsf"+a.ToString()+"adsfasdf"; // Label1.Text = string.Format("asdfadsf{0:C}ad...
阅读全文
摘要:http://www.chenjiliang.com/Article/View.aspx?ArticleID=2956&TypeID=88
阅读全文
摘要:private void CreateEditBox(object sender) { listBox1= (ListBox)sender ; itemSelected = listBox1.SelectedIndex ; Rectangle r = listBox1.GetItemRectangle(itemSelected); string itemText = (string)list...
阅读全文
摘要:using System; using System.Text; using System.Security.Cryptography; using System.IO; //默认密钥向量 private static byte[] Keys = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF }; /// /// DES加密字符串 /// ...
阅读全文
摘要:在工作中常常需要将特定的文件提取出来生成CHM格式文件便于查阅,例如将函数头提取出生成CHM文档。 下面的HtmlToChmClass类实现将FilePath目录下的HTML文件转化为CHM文档。 HtmlToChmClass可以很方便的运用于C#中界面程序。只需要调用相应的接口,实现与界面设计分离。 /*...
阅读全文
摘要:编程中很多细节问题,我们都要十分的注意,要不一个小小的字母错误就能引起程序的无法运行,我自己就经历过这样的事情,对于编程中应该注意的问题,我们要经常的收集整理自己的一本手册,现在我们来讲下C#中的@符号的使用及注意事项。
阅读全文
摘要:C# Visual Studio 2005中RichTextBox保存文件为rtf格式
SaveFileDialog saveFile1 = new SaveFileDialog();
// Initialize the SaveFileDialog to specify the RTF extention for the file.
saveFile1.DefaultExt = "*.rtf";
saveFile1.Filter = "RTF Files|*.rtf";
// Determine whether the user selected a file name from the saveFileDialog.
if (saveFile1.ShowDialog() == System.Windows.Forms.DialogResult.OK &&
saveFile1.FileName.Length 0)
{
// Save the conte
阅读全文
摘要:开发基于.Net平台上的程序员是很难从本质上把Visual C#和ActiveX组件联起来,虽然在使用Visual C#开发应用程序时,有时为了快速开发或者由于.Net FrameWork SDK的不完整,还需要借助ActiveX。但即使如此,也很难把二者联系起来。其中的原因就是能够被Visual C#直接使用文件和通过Visual C#生成的可执行程序只可能是托管的文件。而Active X组...
阅读全文