摘要: 1、Mvc程序的启动页的设置:修改程序的Global.asax文件 更改:New{controller=”home”,action=”index”,id=UrlParameter.Optional}Contrloller:为起始文件夹,action:为起始文件名,id:为传的参数;2、Mvc创建Views(视图):(mvc的视图V一定要放在文件里面);3、Mvc创建Controllers(控制器):创建控制器的时候名称一定要和创建的视图文件名称一致(HomeController.cs Home为视图的文件夹名称);4、 Mvc创建Models(模型): public class Post { 阅读全文
posted @ 2014-02-26 17:38 贝小贝 阅读(371) 评论(0) 推荐(0) 编辑
摘要: /// /// 根据年月日计算星期几 /// /// 年 /// 月 /// 日 /// public static string CaculateWeekDay(int y, int m, int d) { if (m == 1) m = 13; if (m == 2) m = 14; int week = (d + 2 * m + 3 * (m + 1) / 5 + y + y / 4 - y / 10... 阅读全文
posted @ 2014-01-20 14:28 贝小贝 阅读(1097) 评论(4) 推荐(0) 编辑
摘要: 从网上找到的非常好用的模拟ftp管理代码,整理了一下,希望对需要的人有帮助using System; using System.Collections.Generic; using System.Text; using System.Net; using System.IO; using System.Windows.Forms;namespace ConvertData{ class FtpUpDown { string ftpServerIP; string ftpUserID; string ftpPassword; F... 阅读全文
posted @ 2014-01-13 13:53 贝小贝 阅读(1084) 评论(0) 推荐(0) 编辑
摘要: /// /// 创建新文件 /// /// 文件路径 /// 文件名称 public void AddFile(string parentPath, string FileName) { parentPath = Server.MapPath(parentPath); bool flag = !Directory.Exists(parentPath + FileName); if (!flag) { ... 阅读全文
posted @ 2014-01-08 11:01 贝小贝 阅读(669) 评论(0) 推荐(0) 编辑
摘要: 今天闲来无事,测试了一下用Sql分页语句,从网上找了一些数据,总结Sql分页分为5种:--写法1,not in/topselect top 50 * from pagetest where id not in (select top 9900 id from pagetest order by id)order by id--写法2,not existsselect top 50 * from pagetest where not exists (select 1 from (select top 9900 id from pagetest order by id)a where a.id=. 阅读全文
posted @ 2013-12-31 11:51 贝小贝 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 首先创建一个类,类名称为FileControl, /// /// 获取制定文件夹下面的文件夹 /// /// 文件夹名称 /// public static DataTable FileDirList(string FileDir) { DataTable dt = new DataTable(); dt.Columns.Add("dir_id"); dt.Columns.Add("dir_name"); ... 阅读全文
posted @ 2013-11-05 15:34 贝小贝 阅读(388) 评论(0) 推荐(0) 编辑
摘要: 在网站的开发的时候,总是会用到一些前台的提示的script的代码,从项目中整理了一份常用的方法。public class Jscript { public Jscript() { // // TODO: 在此处添加构造函数逻辑 // } /// /// 跳转页面 /// /// public static void RedirectTo(string url) { Htt... 阅读全文
posted @ 2013-10-30 16:25 贝小贝 阅读(1117) 评论(0) 推荐(0) 编辑
摘要: 判断a表中有而b表中没有的记录select a.* from tbl1 a left join tbl2 bon a.key = b.keywhere b.key is null 虽然使用in也可以实现,但是这种方法的效率更高一些2. 新建一个与某个表相同结构的表select * into bfrom a where 113.between的用法,between限制查询数据范围时包括了边界值,not between不包括select * from table1 where time between time1 and time2select a,b,c, from table1 where . 阅读全文
posted @ 2013-10-29 10:06 贝小贝 阅读(200) 评论(0) 推荐(0) 编辑
摘要: #region 参数传递方法第一种 //参数设置方法(第一种) //SqlParameter sp = new SqlParameter("@Name", str_Name); //SqlParameter sp2 = new SqlParameter("@Pwd", str_Pwd); //cmd.Parameters.Add(sp); //cmd.Parameters.Add(sp2);#endregion//简单的一般使用第一种#region 参数传递的第二种方法(是第一种的省略传递变量) cmd.Parameters.Add(new SqlPar 阅读全文
posted @ 2013-10-23 09:07 贝小贝 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 最近在研究静态页输出的问题,找了一些资料。做了一个简单的模板模式的静态输出模板代码: {$_title}{$_Newstitle}{$_NewsInfo}生成静态页的后台代码:protected void Shencheng() { string title = "静态页输出"; string Newstitle = "新闻标题"; string NewInfo = "新闻内容的输入死了的房间了深刻的缴费历史的缴费历史的减肥了似的离开房间乐山大佛上的浪费空间了"; string HtmlName = "ceshi.html& 阅读全文
posted @ 2013-10-18 15:24 贝小贝 阅读(476) 评论(0) 推荐(0) 编辑