2008年1月4日
#
insert into tablename(name,s) select name,5 from test where s=1
没想到还挺有用的。。以前从没用过。。
不一定要ArrayList!!!!!
返回DataReader有时可以减轻很多工作量
Ext太疯狂了..无语,从此Myblogs又要多一个分类了..
Ext..哈哈
protected void Button1_Click(object sender, EventArgs e)
{
if (this.FileUpload1.HasFile)
{
// FileInfo file = new FileInfo(this.FileUpload1.FileName);
this.FileUpload1.PostedFile.SaveAs(Server.MapPath(this.FileUpload1.FileName));
//string con = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + Server.MapPath(this.FileUpload1.FileName) + ";Extended Properties=Excel 8.0; ";//下面连接字符串03和07都支持
string con = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Server.MapPath(this.FileUpload1.FileName) + ";Extended Properties=\"Excel 12.0;HDR=YES\";";
OleDbConnection objCon = new OleDbConnection(con);
string strSel = "select * from [Sheet1$]";
OleDbDataAdapter objAdapter = new OleDbDataAdapter(strSel, objCon);
DataSet ds = new DataSet();
objCon.Open();
objAdapter.Fill(ds);
objCon.Close();
this.GridView1.DataSource = ds;
this.GridView1.DataBind();
}
}
if (this.FileUpload1.HasFile)
{
// FileInfo file = new FileInfo(this.FileUpload1.FileName);
this.FileUpload1.PostedFile.SaveAs(Server.MapPath(this.FileUpload1.FileName));
}
//构造函数
function Listener()
{
}
Listener.isie=document.all?true:false;
//参数:对象,事件(不用on),绑定的方法名
Listener.addListener=function(obj,eventname,method)
{
if(eventname.indexOf("on") == 0)
{
alert("添加的事件不要前缀on!");
return;
}
if(method!=null)
{
if(Listener.isie)
{
eventname = "on" + eventname;
obj.attachEvent(eventname,method);
}
else
{
obj.addEventListener(eventname,method,false);
}
}
}
放弃了一2000+/月
又放弃了3000+/月
却选择了1000+/月
我对了?我错了?
<database>
<school-info>
<name>aaaaaaaaaaaaa</name>
<city>aaaaaa</city>
<stu>aaaaaaa</stu>
</school-info>
<school-info>
<name>aaaaaaaaaaaaa</name>
<city>aaaaaa</city>
<stu>aaaaaaa</stu>
</school-info>
<school-info>
<name>aaaaaaaaaaaaa</name>
<city>aaaaaa</city>
<stu>aaaaaaa</stu>
</school-info>
<school-info>
<name>aaaaaaaaaaaaa</name>
<city>aaaaaa</city>
<stu>aaaaaaa</stu>
</school-info>
</database>
<BODY>
<xml id="schools" src="example.xml"></xml>
<table datasrc="#schools" id="schoolinfo" width="80%" align="center" cellpadding="0" cellspacing="0" border="1">
<thead>
<th>学校名称</th>
<th>城市</th>
<th>学生人数</th>
</thead>
<tr>
<td><div datafld="name"></div></td>
<td><div datafld="city"></div></td>
<td><div datafld="stu"></div></td>
</tr>
</table>
</BODY>
</HTML>
<script type="text/javascript">
var xmlHttp;
function createXMLHttpRequest()
{
if(window.ActiveXObject)
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if(window.XMLHttpRequest)
{
xmlHttp = new XMLHttpRequest();
}
}
function startRequest()
{
createXMLHttpRequest();
xmlHttp.onreadystatechange = handleStateChange;
xmlHttp.open("GET","person.xml",true);
xmlHttp.send(null);
}
function handleStateChange()
{
if(xmlHttp.readyState==4)
{
if(xmlHttp.status==200)
{
alert("来自服务器的响应:"+xmlHttp.responseText);
}
else
{
alert("aaaa");
}
}
}
</script>
摘要: 小的细节问题,总是会被忽略掉,哎
阅读全文
工作已经换了,但是心情还是提不起来.
不知道是什么原因,总是烦..
Timer t = new Timer();
t.schedule(new java.util.TimerTask() {
private int count = 0;
public void run() {
count++;
System.out.println("执行成功-" + count);
if (count > 40) {
this.cancel();
}
}
}, 0, 1000);
也许以后会用上..
DELIMITER $$;
DROP PROCEDURE IF EXISTS `myweb`.`test`$$
CREATE PROCEDURE `test`()
BEGIN
declare _done int default 0;
declare _id int default 0;
declare prod int default (select id from luck limit 5,1);
declare cur_mid cursor for
select m.id from member;
declare continue handler for sqlstate '02000' set _done = 1;
open cur_mid;
repeat
fetch cur_mid into _id; #当然也可以有多个
if not _done then
#处理。。可以使用 _id ,
end if;
until _done end repeat;
close cur_mid;
END$$
DELIMITER ;$$
摘要: asp.net实现发送email
阅读全文
http://tinymce.moxiecode.com
http://tinymce.moxiecode.com/download.php
使用方法
http://www.cublog.cn/u/16928/showart.php?id=255585
DELIMITER $$;
DROP PROCEDURE IF EXISTS `myweb`.`gettopiclist`$$
CREATE PROCEDURE `myweb`.`gettopiclist` (in classid int,
in page int,
in pagesize int,
out acount int)
BEGIN
set @startrow=(page-1)*pagesize;
set @p1 = @startrow;
set @p2 = pagesize;
set @p3 = classid;
set @query='select id,title,postdate,revertnum,clicknum,uid,username
from posttopic where id<=(select id from posttopicview ';
if classid=0 then
set @query=concat(@query,' order by postdate desc limit ?,1)
order by postdate desc limit ?;');
prepare querystr from @query;
execute querystr using @p1,@p2;
set acount=(select count(id) from posttopicview);
else
set @query=concat(@query,' where cid=? order by postdate desc limit ?,1)
order by postdate desc limit ?;');
prepare querystr from @query;
execute querystr using @p3,@p1,@p2;
set acount=(select count(id) from posttopicview where cid=classid);
end if;
deallocate prepare querystr;
END$$
DELIMITER ;$$
呆不下去了..想想你,离开这个公司.你还能做什么????
真的..是时候走了.
无聊真的很痛苦..
http://main.mapbar.com/city/nanjing/
if(!isTokenValid(request))
{
//do things..
saveToken(request);
}
else
{
System.out.println("--------------");
}
如果我们不小心安装VS 2008的时候,没有事先更改CDKEY 我们也可以这么做来实现VS 2008的注册
在“添加删除”里面选择删除"Microsoft Visual Studio Team System 2008 Team Suite--简体中文",然后在打开的窗口中选择最后一项“添加注册码升级到正式版”,在里面输入下面的cd-key:
N:PYHYP-WXB3B-B2CCM-V9DX9-VDY8T
此时VS2008提示升级成功。
reg export HKLM\Software\Policies\Microsoft\Windows\Installer installer.reg
reg add HKLM\Software\Policies\Microsoft\Windows\Installer /v MaxPatchCacheSize /t REG_DWORD /d 0 /f
net stop msiserver
start /wait VS80sp1-KB926604-X86-CHS.exe
reg delete HKLM\Software\Policies\Microsoft\Windows\Installer /v MaxPatchCacheSize /f
reg import installer.reg
net stop msiserver
del /q installer.reg 2>nul
private void CreateCodeImg(string sCode)
{
if ((((sCode != null)) & (sCode.Trim() != LibConst.UC_STR_NULL)))
{
double width = sCode.Length * 13;
Bitmap CodeBitmap = new Bitmap(Convert.ToInt32(Math.Ceiling(width)), 22);
Graphics CodeGraphics = Graphics.FromImage(CodeBitmap);
try
{
// 生成随机生成器
Random LineRand = new Random();
// 清空图片背景色
CodeGraphics.Clear(Color.White);
// 画图片的背景噪音线
int iLineCnt;
for (iLineCnt = 0; iLineCnt <= 25 - 1; iLineCnt++)
{
int PointBeginX = LineRand.Next(CodeBitmap.Width);
int PointBeginY = LineRand.Next(CodeBitmap.Height);
int PointEndX = LineRand.Next(CodeBitmap.Width);
int PointEndY = LineRand.Next(CodeBitmap.Height);
CodeGraphics.DrawLine(new Pen(Color.Moccasin), PointBeginX, PointBeginY, PointEndX, PointEndY);
}
Font CodeFont = new Font("Arial", 12f, (FontStyle.Italic | FontStyle.Bold));
LinearGradientBrush CodeBrush = new LinearGradientBrush(new Rectangle(0, 0, CodeBitmap.Width, CodeBitmap.Height), Color.Black, Color.Black, 1.2f, true);
CodeGraphics.DrawString(sCode, CodeFont, CodeBrush, 2f, 2f);
// 画图片的前景噪音点
int iPointCnt;
for (iPointCnt = 0; iPointCnt <= 100 - 1; iPointCnt++)
{
int PointX = LineRand.Next(CodeBitmap.Width);
int PointY = LineRand.Next(CodeBitmap.Height);
CodeBitmap.SetPixel(PointX, PointY, Color.FromArgb(LineRand.Next()));
}
// 画图片的边框线
CodeGraphics.DrawRectangle(new Pen(Color.Gainsboro), 0, 0, (int)(CodeBitmap.Width - 1), (int)(CodeBitmap.Height - 1));
// 输出图片
MemoryStream CodeStram = new MemoryStream();
CodeBitmap.Save(CodeStram, ImageFormat.Gif);
Response.ClearContent();
Response.ContentType = "image/Gif";
Response.CacheControl = "no-cache";
Response.Expires = -1;
Response.BinaryWrite(CodeStram.ToArray());
}
finally
{
CodeGraphics.Dispose();
CodeBitmap.Dispose();
}
}
}
还有几个命名空间
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
<object id="playersound" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject"
width="0" height="0">
<param name="url" value="1.wav" />
<param name="autoStart" value="false" />
<param name="balance" value="0" />
<param name="currentPosition" value="0" />
<param name="currentMarker" value="0" />
<param name="enableContextMenu" value="true" />
<param name="enableErrorDialogs" value="false" />
<param name="enabled" value="true" />
<param name="fullScreen" value="false" />
<param name="invokeURLs" value="false" />
<param name="mute" value="true" />
<param name="playCount" value="1" />
<param name="rate" value="1" />
<param name="uiMode" value="none" />
<param name="volume" value="100" />
</object>
可悲啊!master也是个类啊!居然忘了
((命名空间.母板的类)(this.Page.Master)).属性 = "你好";
////此页面不允许敲回车键
window.onload=function()
{
document.body.onkeydown=judge_isEnter;
}
var isIe=document.all?true:false;
function judge_isEnter()
{
if(isIe)
{
if(event.keyCode==13)
return false;
}
}
摘要: 第一种:(最简单的方式) Global.asax里填加代码
第二种:用插件 Intelligencia.UrlRewriter.dll
阅读全文
摘要: 非本人原创,具体转载地址忘了..并做了些修改...
阅读全文
摘要: 一个绑定列,一个模板,写出来主要是为了区别下,在后台中如何去数据.....
阅读全文
网上也有很多代码,MSDN里也有详细的介绍.在这里我也帖出我的代码.可以成功发送的
SmtpClient client = new SmtpClient();
client.Host = "smtp.163.com";//smtp地址
client.UseDefaultCredentials = true;
client.DeliveryMethod =SmtpDeliveryMethod.Network;
client.Credentials = new System.Net.NetworkCredential("用户名", "密码");
MailMessage mess = new MailMessage();
mess.From = new MailAddress("发件人邮箱");
mess.To.Add(new MailAddress("收件人邮箱"));
mess.Subject = "主要用于test";
mess.Body = "正文";
try
{
client.Send(mess);
this.Label1.Text = "发送成功完成 ";
}
catch (Exception ex)
{
this.Label1.Text = ex.Message;
}
刚开始的时候抛出了异常.但是后来就再也没有.有点晕.
知道了,就知道简单了..百度一下才知道是
<%#Container.ItemIndex %>
当然是从0开始的..
几天来没事就在园子里转,发现该学习的地方太多了..
初级程序员也许离我还远..
摘要: 第一步. 页面Page指令中加上EnableEventValidation="false",如果不加,报错就是必然的了.
第二步. 页面.cs代码中重写VerifyRenderingInServerForm(Control control) 这个方法.代码如下,直接为空就OK了.不重写也可以,就是会报错.呵呵..
阅读全文
以前都是潜水,只看文章.现在自己也在园子里开个..
昨天注册成功,今天仔细看看后台.感觉就是不一样,以后就在园子里混了..哈哈..
本人语言能力有限,前言不搭后语..如果写不出什么好文章.别笑话.