2008-4-24 13:09:15 '/*========================================================================= ' * Intro .txt文本切割器,默认为8000个字符切为一个文件。支持拖动。 ' * FileName SplitFile.vbs ' * Author yongfa365 ' * Version v1.0 ' * WEB http://www.yongfa365.com ' * Email yongfa36.. |
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-21 12:45:24 FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][path]filename[ ...]]
/V 显示所有未包含指定字符串的行。 /C 仅显示包含字符串的行数。 /N 显示行号。 /I 搜索字符串时忽略大小写。 /OFF[LINE] 不要跳过具有脱机属性集的文件。 "string" 指定要搜索的文字串。 [drive:][path]filename 指定要搜索的文件。
|
2008-4-20 23:56:53 搜索引擎蜘蛛把页面代码送回搜索引擎服务器后,SE是如何判断页面中最核心的内容呢?
先说下Kyw认为的搜索引擎运作过程的前几个步骤: 1. 蜘蛛下载A页面,送回服务器; 2. 服务器寻找A页面的核心内容位置,然后去除HTML代码; 3. 寻找网页核心内容; ……
我不确定GOOGLE、百度、YAHOO!是否真的有&ld.. |
2008-4-20 14:56:19 --通用表结构 --drop table Movies CREATE TABLE [dbo].[Movies] ( [ID] integer primary key identity(1,1) not null,--ID,主键,自动号 [txtTitle] varchar(255),--标题 [txtContent] text null ,--内容 [PutTime] datetime DEFAULT (getdate()),--提交时间 [ModiTime] datetime DEFAULT (getdate()),--修改时间 [Hits] integer Default (0),--点击数 [Flags] integer Default (0) ,--标识 [OrderID] integer Default (0),--排序号 ) |
2008-4-20 1:21:34 以前在写一查询时总是要关注这个字段是数字型的还是字符型的,好按格式写相关SQL语句,今天在写一语句时突然发现
abc='fs' 提示,在从字符型转为数字型时失败!
我就想难不成SQL Server会自己为你转换数据类型,于是测试了下,果不其然,
即便你的字段类型是字符型的,只要里面都是数字,那么你就可以把它当数字型的来用,
跟数字型的好像没什么差别,但肯定是有差别的,只是可以这样用罢了。
|
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[]..
|
2008-4-18 11:57:25 public static String[] RemoveDup(String[] myData) { if (myData.Length > 0) { Array.Sort(myData); int size = 1; for (int i = 1; i < myData.Length; i++) if (myData[i] != myData[i - 1]) size++; String[] myTempData = new Str.. |
2008-4-18 11:23:52 宋玉和孟倩倩起早来到某区婚姻登记处,窗口里有两个工作人员,一男一女。两个人都是面色苍白,脸上不停往下流汗。 宋玉说:“我们登记。 ”男的没抬头,问:“你们登多少钱的记?”宋玉和孟倩倩疑惑不解。男的指指窗口玻璃上贴的一张纸。纸上写着:一千元、五百元、一百元、五十元、免费、奖励.. |
2008-4-17 15:30:59 前些天在处理一个客户网站时,发现一个问题,本以为是flash太大造成的,没想到排除到最后,是这句话的问题: <td background="dian.gif"> 每次只要向上滚动网页到这个区域时都会卡好一会,这时我观察CPU都100% 然后删除这个背景后,发现问题解决,然后我看了下他那个dian.gif,还真是只有一个小点,那显示的那么一堆点都是.. |
2008-4-14 12:08:35 做SEO的,或推广网站的可能都用过群发,想快速获得更多反向链接,但不知道大家有没有注意到,很多时间群发的结果是网站的排名反而靠后了,尤其是baidu上的排名,为什么呢,我想应该是搜索引擎判断出你是通过群发来实现反向链接的。 这个过程是可以理解,但又转念一想,如果你不是群发推广自己的网站而是带上竞争对.. |
| | | | 文章分类 | | |
|