Loading

摘要: 1.2 Client-Side JavaScript:confirm()函数:用于弹出确认对话框,setTimeout()函数用于,设置超时时间。 <script type="text/javascript"> function moveon() { var answer = confirm("Ready to move On?"); if(answer) { window.location = "Http://Google.com"; } }; setTimeout(moveon,6000); </script&g 阅读全文
posted @ 2012-08-16 17:44 青岛欧姆网络科技 阅读(249) 评论(0) 推荐(0)
摘要: 最佳答案:public static int Fab(int n) { if (n == 1 || n == 2) { return 1; } else { return Fab(n - 1) + Fab(n - 2); } }其他: i++; sum = x + y; x = y; if ... 阅读全文
posted @ 2012-08-15 11:00 青岛欧姆网络科技 阅读(1124) 评论(0) 推荐(0)
摘要: 简单答案:1.父类:public virtual string ToString(){return "a";}子类:public override string ToString(){return "b";}2.同一类中或父子关系类中皆可:public string ToString(){return "a";}public string ToString(int id){return id.ToString();}override是用于重写基类的虚方法,这样在派生类中提供一个新的方法重载是提供了一种机制, 相同函数名通过不同的返回值 阅读全文
posted @ 2012-08-15 10:26 青岛欧姆网络科技 阅读(272) 评论(0) 推荐(0)
摘要: private:私有成员,在内部类中才可以访问。protected:保护成员,在内部类和继承类中可以访问。public:公共成员,完全公开,没有访问限制。internal:在同一命名空间内可以访问。 阅读全文
posted @ 2012-08-15 10:18 青岛欧姆网络科技 阅读(386) 评论(0) 推荐(0)
摘要: “找到多个与名为“Home”的控制器匹配的类型。如果为此请求(“{controller}/{action}/{id}”)提供服务的路由在搜索匹配此请求的控制器时没有指定命名空间,则会发生此情况。如果是这样,请通过调用含有“namespaces”参数的“MapRoute”方法的重载来注册此路由。”出现该问题的愿原因是在默认的Golbal.asax.cs文件中已经注册了默认路由 public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.ax... 阅读全文
posted @ 2012-07-15 11:08 青岛欧姆网络科技 阅读(556) 评论(0) 推荐(0)
摘要: 轉換字符效果a等同於appdomainappdomainUsed to output the friendly name of the AppDomain where the logging event was generated.用於輸出日誌事件發生的AppDomain的一個友好的名字c等同於loggerC等同於typeclass等同於typed等同於datedate用於輸出日誌事件在當前時區中的日期.若要輸出通用時間,請使用%utcdate模式.日期轉換指定符後可以跟隨一對閉合的花括號,花括號裡面為日期格式指定符.例如:%date{HH:mm:ss,fff}或%date{dd MMM yy 阅读全文
posted @ 2012-07-13 10:25 青岛欧姆网络科技 阅读(418) 评论(0) 推荐(0)
摘要: The routing system has two functions:1. Examine an Incoming URL and figure out for which controller and action the request is intended.2.Generate outgoing URLs.These are URLs that appear in the HTML rendered from our views so that a specific action will be invoked when the user clicks the link.The R 阅读全文
posted @ 2012-07-11 18:47 青岛欧姆网络科技 阅读(163) 评论(0) 推荐(0)
摘要: 在练习《PRO MVC3 Professional》 第9章的实例的时候,碰到一个问题,之前可能看得不是很仔细,还没有注意到这个问题,直到今天添加上传图片的问题才发现不管自己怎么添加,图片都没法添加到数据库里去。后来发现,新加项目的时候是可以的,只是编辑更新的时候不行,郁闷了大半个下午,终于在网上找到了正确的解决方法,原来老美写的教科书也会有错误。。。看来还真是尽信书不如无书。例子是书里的一个SportsStore实例,更新的方法在AdminController里代码:[HttpPost] public ActionResult Edit(Product product,Http... 阅读全文
posted @ 2012-07-06 19:25 青岛欧姆网络科技 阅读(2435) 评论(0) 推荐(0)
摘要: 之前一直在按照书中的步骤使用,感觉上还不是很清晰,今天总结了一下使用方法:第一步:新建一个控制台项目:创建实体类Productclass Product { public int ProductID { get; set; } public string Name { get; set; } public string Description { get; set; } public string Category { get; set; } public decimal Price { get; set; } ... 阅读全文
posted @ 2012-07-06 11:49 青岛欧姆网络科技 阅读(426) 评论(0) 推荐(0)
摘要: 昨天因为要改公司的网站,不小心把VS下的machine.config文件给改了,导致再次运行SportStore 项目的时候,报了次错然后,重新安装http://www.microsoft.com/zh-cn/download/details.aspx?id=17876,问题解决。 阅读全文
posted @ 2012-07-06 10:28 青岛欧姆网络科技 阅读(123) 评论(0) 推荐(0)