posts - 162,comments - 41,views - 30万
02 2011 档案
html动态显示时间
摘要:注:setInterval和setTimeout的区别setInterval是按照设置的时间无限次数的刷新setTimeout是按照设置的时间值刷新一次所以例二setTimeout实现了递归回调 无标题页 ====================================================================或者 无标题页 阅读全文
posted @ 2011-02-18 17:12 高兴happy 阅读(11081) 评论(0) 推荐(0) 编辑
获取服务器信息
摘要:先新建一个winform项目,在拖入listView1控件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.ServiceProcess;namespace 获取服务信息{ public partial class Form1 : Form { public Form1( 阅读全文
posted @ 2011-02-18 16:37 高兴happy 阅读(279) 评论(0) 推荐(0) 编辑
在配置文件中定义初始值然后读取
摘要:先添加名为ConfigUtil 的类文件using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Configuration;using System.Xml;namespace MakeSiteMap.Utils{ /// /// 对配置文件[App.config]进行操作 /// public class ConfigUtil { #region Methods /// /// 通过 key 读取配置文件的值 /// /// /// public ... 阅读全文
posted @ 2011-02-18 16:24 高兴happy 阅读(425) 评论(0) 推荐(0) 编辑
sql游标
摘要:declare id_cursor CURSOR FOR SELECT id FROM #t1 ----创建游标Open id_cursor ---打开游标declare @id int,@S varchar(100), @S1 varchar(100),@S2 varchar(100),@S3 varchar(100),@publisher nvarchar(255),@addre nvarchar(255),@postcode float,@phone nvarchar(255)fetch next from id_cursor into @id ---游标第一次移动并复制给参数selec 阅读全文
posted @ 2011-02-18 16:16 高兴happy 阅读(294) 评论(0) 推荐(0) 编辑
动态生成图片
摘要:using System;namespace KuCun{ class Program { static void Main(string[] args) { string str = "{0} {1} {2}"; BuildImage buildImage = ImageProvider.Provider; for (int i = 0; i /// 图片提供程序 /// public static class ImageProvider { private static BuildImage buildImage = null; /// /// 生成图片 /// pub 阅读全文
posted @ 2011-02-18 16:13 高兴happy 阅读(2026) 评论(0) 推荐(0) 编辑
读取文件夹中的文件
摘要:public static void Main(string[] args) { DirectoryInfo dir = new DirectoryInfo(@"E:\书摘与插图\9"); Addpicture.showDir(dir); } namespace TaoBaoAddPicture{ public class Addpicture { private static string FullName; private static int name; public static void showDir(DirectoryInfo dir) { Console.W 阅读全文
posted @ 2011-02-18 16:11 高兴happy 阅读(543) 评论(0) 推荐(0) 编辑
高亮显示当前行
摘要:protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='yellow',this.style.fontWeight='bold'"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=&# 阅读全文
posted @ 2011-02-18 16:01 高兴happy 阅读(1302) 评论(0) 推荐(1) 编辑
Repeater
摘要:在Repeater1中点击点击查看详情按钮 在Reperter2中显示信息protected void _details(object sender,EventArgs e) { this.Panel2.Visible=true; HtmlAnchor a = (HtmlAnchor)sender;//取出reperter1中的a标签中的内容 int productid=Convert.ToInt32(a.Title.ToString());//取出a标签中title上绑定的值//绑定 string sql = string.Format("select Description fr 阅读全文
posted @ 2011-02-18 16:01 高兴happy 阅读(1133) 评论(0) 推荐(1) 编辑
弹出打开窗口
摘要:OpenFileDialog obj = new OpenFileDialog(); if (obj.ShowDialog() == DialogResult.OK) { this.txtpath.Text = obj.FileName; }弹出打开窗口,将地址保存this.txtpath.TextOpenFileDialog obj = new OpenFileDialog(); if (obj.ShowDialog() == DialogResult.OK) { this.txtpath.Text = obj.FileName; } 阅读全文
posted @ 2011-02-18 16:00 高兴happy 阅读(195) 评论(0) 推荐(0) 编辑
向表前加行号
摘要:GridView没有自动加行号的功能,记录需要行号的话,可以在模板列中使用repeater数据库查询序号: RowNumber:select rownumber() over (order by bookid) as rownumber ,* from booksource这句话主要用到了rownumber!而rownumber的主要语法(即结构)是:rownumber() over(order by @) 以@排序为表添加一个自曾的列! 所以上面的spl语句的意思是:为表booksource创建一个名为rownumber的自曾列! 阅读全文
posted @ 2011-02-18 15:59 高兴happy 阅读(190) 评论(0) 推荐(0) 编辑
统计合并griview2
摘要:注:将ShowFooter属性设置为true int mysum1 = 0; Double mysum2 = 0; protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { DataRowView myrows = (DataRowView)e.Row.DataItem; //要统计总数的列 mysum1 += Convert.ToInt32(myrows[8].ToString()); my. 阅读全文
posted @ 2011-02-18 15:56 高兴happy 阅读(180) 评论(0) 推荐(0) 编辑
日期格式化处理
摘要:string today = ""; string yesterday = ""; string format = "yyyy-MM-dd hh:mm:ss"; today = System.DateTime.Now.ToString(format, DateTimeFormatInfo.InvariantInfo); yesterday = DateTime.Now.AddDays(-1).ToString(format, DateTimeFormatInfo.InvariantInfo); string DayTodaty = t 阅读全文
posted @ 2011-02-18 15:55 高兴happy 阅读(235) 评论(0) 推荐(0) 编辑
导出excel二
摘要:griview导出先设置protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataLoad(); } } private void DataLoad() { object[] obj = { 0 }; DataSet ds = CM.DataAccess.dataDrive.WelanMain.connProcedureExec("CustomerAddress", obj); this.GridView1.DataSource = ds.Tables[0]; this.Gri 阅读全文
posted @ 2011-02-18 15:52 高兴happy 阅读(291) 评论(0) 推荐(0) 编辑
导出excel
摘要:protected void Button1_Click(object sender, EventArgs e) { string fileName = "WLSearch_Favorites.xls"; string sendMethdo = this.DropDownList1.Text; object[] obj = { sendMethdo }; DataTable dt = CM.DataAccess.dataDrive.WelanMain.connProcedureExec("CustomerAddress", obj).Tables[0]; 阅读全文
posted @ 2011-02-18 15:47 高兴happy 阅读(308) 评论(0) 推荐(0) 编辑
GriView 添加合并行 1
摘要:前提:设置属性ShowFooter="True"方法一:使用SQL查询统计出合计值,在绑定GridView时让其结果赋于一个DataTable(全局变量),然后在RowDataBound事件中if(e.Row.RowType==DataControlRowType.Footer){e.Row.Cells[0].Text="合计";e.Row.Cells[3].Text=dtSum.Rows[0][0].ToString();e.Row.Cells[4].Text=dtSum.Rows[0][1].ToString();e.Row.Cells[5].Tex 阅读全文
posted @ 2011-02-18 15:42 高兴happy 阅读(240) 评论(0) 推荐(0) 编辑
GridView 1 分页 全选 编辑 删除 更新
摘要:无标题页 using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;us... 阅读全文
posted @ 2011-02-18 15:39 高兴happy 阅读(570) 评论(0) 推荐(0) 编辑
线程
摘要:Tobao_SynProducts.synTaobao.ShiJiWeLan 蔚蓝 = new Tobao_SynProducts.synTaobao.ShiJiWeLan(); Thread th蔚蓝 = new Thread(new ThreadStart(蔚蓝.run)); //创建线程 蔚蓝.run为 运行方法 th蔚蓝.Priority = ThreadPriority.AboveNormal; //为线程设置优先级 th蔚蓝.Start(); //启动线程Tobao_SynProducts.synTaobao.HuangMoGanLin 荒漠甘霖 = new Tobao_SynPr 阅读全文
posted @ 2011-02-18 15:37 高兴happy 阅读(184) 评论(0) 推荐(0) 编辑
抓取淘宝分类
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Net;using System.Text.RegularExpressions;using System.IO;namespace taobao_trades_sold_get{ class Program { public static void Main(string[] args) { //taobao_trades_sold_get.OrderDown down = new OrderDown() 阅读全文
posted @ 2011-02-18 15:26 高兴happy 阅读(458) 评论(0) 推荐(0) 编辑
文件读写小记
摘要:一:文件读取filestream读取:public void reader(){string s = ""; FileStream file = new FileStream(@"d://shop_category[1].txt", FileMode.Open); StreamReader reader = new StreamReader(file,Encoding.Default); while (reader.ReadLine() != null) { s += reader.ReadLine(); }Console.WriteLine(s);}S 阅读全文
posted @ 2011-02-18 15:18 高兴happy 阅读(216) 评论(0) 推荐(0) 编辑
XML随笔
摘要:读取Xml节点内容public void readXml(){string str = ""; XmlReader re = XmlReader.Create(@"d://s.xml"); while (re.Read()) { if (re.NodeType == XmlNodeType.Text) { str += re.Value+"\r\n"; } } console.writeline(str);}XmlDocument下载节点为“title”的内容public void read(){string str="&q 阅读全文
posted @ 2011-02-18 15:17 高兴happy 阅读(209) 评论(0) 推荐(0) 编辑
ruwnumber自定义分页
摘要:一:row_number方法分页string Sql="select * from (select row_number() over (order by created) as row_number,* from contents) as T where T.row_number>"+(pagenumber-1)*pagesize+"and T.row_number=@startRowIndex and RowRank < (@startRowIndex+@maximumRows) 阅读全文
posted @ 2011-02-18 15:15 高兴happy 阅读(449) 评论(0) 推荐(0) 编辑
二进制--图片相互转换
摘要:图片转化为二进制picpath为图片地址using (FileStream fs = new FileStream(picpath, FileMode.Open, FileAccess.Read)) { using (BinaryReader read = new BinaryReader(fs)) { photobyte = read.ReadBytes((int)fs.Length); s1 = photobyte.Length; } }二进制转化为图片string sa = dsimg.Tables[0].Rows[0]["image"].ToString(); // 阅读全文
posted @ 2011-02-18 15:11 高兴happy 阅读(6711) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示