摘要: 网上找到的发送邮件的类,改了一点点,在此谢谢原作者的奉献。1.源码: public class CSendMail { private MailMessage mailMessage; private SmtpClient smtpClient; ... 阅读全文
posted @ 2014-01-27 16:40 aswater 阅读(517) 评论(0) 推荐(0) 编辑
摘要: 同事的代码,帮忙修改的,为了实现页面跳转回来后,状态的保持,Service 使用了Session。 主要的JS $.ajax({ url: "/ws/StaffInfo.asmx/Note",//路径/方法 type: "POST", contentType: "application/json", data: "{id:'" + id + "',sex:'" + sex + "',dep:'" + dep + "', 阅读全文
posted @ 2014-01-27 16:32 aswater 阅读(333) 评论(0) 推荐(0) 编辑
摘要: /// /// 下载附件查看 /// /// /// protected void downButton_Command(object sender, CommandEventArgs e) { //传递过来的参数 string fullName = e.CommandArgument.ToString(); string fileName=System.IO.Path.GetFileName(fullName); ... 阅读全文
posted @ 2014-01-27 16:17 aswater 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 功能:可以实现导出整个数据表格或整个页面public bool ExportGv(string fileType, string fileName) { bool flag = false; try { //定义文档类型、字符编码 Response.Clear(); Response.Buffer = true; HttpContext.Current.Response.Charset = "GB2312"; HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding(&qu 阅读全文
posted @ 2014-01-27 16:11 aswater 阅读(634) 评论(0) 推荐(1) 编辑
摘要: 在GridView中隐藏一字段,方便这条记录的处理,同时隐藏一个Button实现点击这条记录时的处理1.绑定 是否批准 待定 同意 不同意 '> 2.处理 实现光棒效果,并注册这条记录点击时的处理 protected void Gv_RowDataBound(object sender, GridViewRowEventArgs e) { Button btn = e.Row.FindControl("hiddenPost") as Button; if (btn != null) { e.Row.Attributes["onclick"] 阅读全文
posted @ 2014-01-27 15:57 aswater 阅读(346) 评论(0) 推荐(0) 编辑
摘要: public class ValidModule : IHttpModule { /// /// 您将需要在网站的 Web.config 文件中配置此模块 /// 并向 IIS 注册它,然后才能使用它。有关详细信息, /// 请参见下面的链接: http://go.microsoft.com/?linkid=8101007 /// #region IHttpModule Members public void Dispose() { //此处放置清除... 阅读全文
posted @ 2013-12-27 18:50 aswater 阅读(573) 评论(0) 推荐(0) 编辑
摘要: 最近用简单的三层架构写代码,虽然代码比较通用,但不够个性化,闲来写了数据记录的分页类,使用起来相对比较通用(想来能写出通用高效的代码真是不容易)列出代码: 1 public class Pagination 2 { 3 //分页总数 4 private int pageCount; 5 public int PageCount 6 { 7 get 8 { 9 return pageCount; 10 ... 阅读全文
posted @ 2013-12-27 18:24 aswater 阅读(256) 评论(0) 推荐(0) 编辑
摘要: /* 运算符using namespace std;class MyInt{ private: int m_i; public: friend void Printf(MyInt const &obj); friend ostream operatorm_i); return *this; } const MyInt operator++(int) { MyInt temp=*this; ++(*this); return temp; } MyInt &operator--() { --(this->m_i); return *this; } const MyInt op 阅读全文
posted @ 2013-10-12 20:48 aswater 阅读(382) 评论(0) 推荐(0) 编辑
摘要: The access rules (clause 11) for a virtual function are determined by its declaration and are not affected by the rules for a function that later overrides it.当一个子类函数通过基类的指针调用时,访问权限取决于基类对该函数的声明。 阅读全文
posted @ 2013-04-28 14:51 aswater 阅读(212) 评论(0) 推荐(0) 编辑
摘要: Windows中模块定义文件模块定义文件(.DEF)用来定义应用程序的模块名和模块属性。对于源文件名、目标文件名、可执行文件名可以由编译命令的参数确定,要记住编译命令的参数也是不容易的。但是,编译Winodws应用程序就不一样了,编译时要考虑的因素就更多,于是,设法把执行文件名等这些参数放在一个文件中,这个文件称为模块定义文件(.DEF).把应用程序的源文通过编译系统变成为一个可执行的文件,执行文件又称为模块,执行文件名又称为模块名。模块定义文件(.DEF)和资源描述文件一样,在应用程序通过编译的时候,为编译系统的工作提供必要的信息,例如模块名、模块属性、规定区段的特性、是固定的还是移动的,堆 阅读全文
posted @ 2013-03-25 12:29 aswater 阅读(599) 评论(0) 推荐(0) 编辑