//Excel批量导入到数据库
protected void btnUpload_Click(object sender, EventArgs e)
{
string IsXls = System.IO.Path.GetExtension(UploadExcel.FileName.ToString().ToLower());
if (IsXls != ".xls")
{
Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script type='text/javascript' language='javascript'>alert('只可以选择Excel文件');location.href='EmployeeAddPage.aspx';</script>");
return;//当选择的不是Excel文件时,返回
}
string filePath = UploadExcel.PostedFile.FileName;
&nb ......
//Excel批量导入到数据库
protected void btnUpload_Click(object sender, EventArgs e)
{
string IsXls = System.IO.Path.GetExtension(UploadExcel.FileName.ToString().ToLower());
if (IsXls != ".xls")
{
Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script type='text/javascript' language='javascript'>alert('只可以选择Excel文件');location.href='EmployeeAddPage.aspx';</script>");
return;//当选择的不是Excel文件时,返回
}
string filePath = UploadExcel.PostedFile.FileName;
&nb ......
ASP.NET Cookies简单应用 记住用户名和密码
ASP.NET Cookies简单应用 记住用户名和密码
2009-06-11 22:45
本文转自http://www.cnblogs.com/wayne-ivan/archive/2008/12/18/1357628.html
不要试图给Password类型的TextBox赋值!
在asp.net中,不要试图给Password类型的TextBox控件赋值! 无论是在设计或是运行时,都不可以的。
猜测的原因是,password类型的TextBox控件从根本上,没有Text属性的Set方法,只有Get !!
同样,html中的Input控件,如果设置为ruanat="server",password类型的Input控件也是一样。无论是在设计或是运行时,都不容许设置它的值。
解决办法:txtPassword.Attributes["value"] = "123";
前言
一般只要有会员、用户机制的网站或论坛在登录的时候都会有这么一个复选框——[记住我的名字 | 两周内不再登陆 | 在此计算机上保存我的信息],说法较多,实现起来差不多,本文做了一个简单的例子并附带了一个C# Cookies帮助类 CookiesHelper.cs和实现代码片段,希望能对初学者有帮助: )
推荐文章
1. ......
yum update 更新系统之后,内核版本出现了两种,一种是PAE,另外一种并没有PAE。
何谓PAE呢?全称:Physical Address Extension
其实就是使32位系统支持超过4G内存,最大可达64G内存。
对于Linux来说,内核从2.6版本开始全面支持PAE[3]
,这使得在32位的机器上可以访问64GB的内存。启用了PAE的Linux内核还需要同样支持PAE的CPU。从2008年起,很多一般的发布的Linux版本都默认使用启用了PAE的内核。
以下是PAE的WIKI百科
http://zh.wikipedia.org/wiki/%E7%89%A9%E7%90%86%E5%9C%B0%E5%9D%80%E6%89%A9%E5%B1%95 ......
linux下apache+php安装常见问题
configure: error: Unable to find libgd.(a|so)
如果使用的是ubuntu或debian就很简单了,直接sudo apt-get install apache2 libapache2-mod-php5 php5 php5-gd 就基本上搞定,但是用源代码安装还是很麻烦~
wget http://www.boutell.com/gd/http/gd-2.0.11.tar.gz
tar zxvf gd-2.0.11.tar.gz
cd gd-2.0.11
sudo ./configure --prefix=/usr/local/gd2
sudo make
sudo make install
再php:~/:./configure …… --with-gd=/usr/local/gd2 ……
以下是转载的,而且都是基于yum install或者apt-get的。
1) Configure: error: xml2-config not found. Please check your libxml2 installation.
Solutions :
Quote:
#yum install
libxml2
libxml2-devel
(For Redhat & Fedora)
# aptitude install lib
xml2
-dev (For ubuntu)
2) Checking for pkg-config… /usr/bin/pkg-config
configure: error: Cannot find OpenSSL’s <evp.h>
Solutions :
Quote:
#yum install
openssl
openssl-devel
3) Configure: error: Pleas ......
linux下apache+php安装常见问题
configure: error: Unable to find libgd.(a|so)
如果使用的是ubuntu或debian就很简单了,直接sudo apt-get install apache2 libapache2-mod-php5 php5 php5-gd 就基本上搞定,但是用源代码安装还是很麻烦~
wget http://www.boutell.com/gd/http/gd-2.0.11.tar.gz
tar zxvf gd-2.0.11.tar.gz
cd gd-2.0.11
sudo ./configure --prefix=/usr/local/gd2
sudo make
sudo make install
再php:~/:./configure …… --with-gd=/usr/local/gd2 ……
以下是转载的,而且都是基于yum install或者apt-get的。
1) Configure: error: xml2-config not found. Please check your libxml2 installation.
Solutions :
Quote:
#yum install
libxml2
libxml2-devel
(For Redhat & Fedora)
# aptitude install lib
xml2
-dev (For ubuntu)
2) Checking for pkg-config… /usr/bin/pkg-config
configure: error: Cannot find OpenSSL’s <evp.h>
Solutions :
Quote:
#yum install
openssl
openssl-devel
3) Configure: error: Pleas ......
<!--
@page { margin: 2cm }
P { margin-bottom: 0.21cm }
-->
近期以来,静观世界
Linux
业界的各种动向,令人心如潮涌,不得安宁。此话怎么讲?
十几年来,
Linux
已经形成一股世界性的发展潮流,任何势力也阻挡不了。许多世界级的大公司都参与其中。在昨天闭幕的
Intel
信息技术峰会上(
IDF
2010
),这一点看得非常清楚。在消费电子领域,
MeeGo
指引着产业发展方向;在计算机桌面创新方面,
Ubuntu
一马当先。
4
月
14
日,《
Linux
基金会》执行主席
Jim
Zemlin
在《
Linux
协作峰会》上发表主题讲演,他指出:
Linux
正好处在几股推动开源应用的重要
IT
势力(或倾向)的交汇处,它必定是个大赢家(
The
big
winner
)。他说:在未来几年,在消费电子领域,
Linux
(平台)必将大方光彩。他确信,在
2
~
5
年内,基于
Linux
的电子消费产品不仅品质极佳而且完全免费(
both
fabulous and
free
)。他的意思是说,到了那时,(
Linux
)客户将不必再去购买消费电子产品的硬件和软件,只需支付服务费(比如,月租费)即可。面对这种发展 ......