上一页 1 ··· 9 10 11 12 13 14 15 下一页
摘要: 网页内插入Js代码<style type="text/css">.eweima{width:200px;height:200px;margin:auto;float:right;}</style><div class="eweima"><script type="text/javascript">document.write("<img src=\"https://chart.googleapis.com/chart?cht=qr&chs=500x500 阅读全文
posted @ 2012-11-08 12:32 Raywang80s 阅读(406) 评论(0) 推荐(0)
摘要: 编写一个类,需要添加一些引用using System.Net;using System.Text;using System.IO;代码如下 public static CookieContainer Cook = new CookieContainer(); public static string CreatRequestGetResponse(string URL, string PostData) { HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(U... 阅读全文
posted @ 2012-11-07 16:59 Raywang80s 阅读(291) 评论(0) 推荐(0)
摘要: C#使用 Server.URLEncode编码 System.Web.HttpUtility.UrlEncode(str,System.Text.Encoding.Unicode);System.Web.HttpUtility.UrlEncode(str,System.Text.Encoding.UTF8);System.Web.HttpUtility.UrlEncode(str,System.Text.Encoding.GetEncoding("GB2312")); 解码System.Web.HttpUtility.UrlDecode(str,System.Text.En 阅读全文
posted @ 2012-11-07 16:49 Raywang80s 阅读(917) 评论(0) 推荐(0)
摘要: 1: ViewData传值方式ViewData的生命周期和View相同, 只对当前View有效. ViewData["zd"] = dfdfd2:TempData传值方式 可以跨Action传递 TempData的数据至多只能经过一次Controller传递, 并且每个元素至多只能被访问一次, 例如一个用法为,抛出一个异常。跳转到error页面public ActionResult Index3(){ TempData["tempIndex"] = "出错了!"; Response.Redirect("/home/error 阅读全文
posted @ 2012-11-06 14:03 Raywang80s 阅读(771) 评论(0) 推荐(0)
摘要: 一Html.ActionLink("linkText","actionName")该重载的第一个参数是该链接要显示的文字,第二个参数是对应的控制器的方法,默认控制器为当前页面的控制器,如果当前页面的控制器为Products,则Html.ActionLink("detail","Detail")则会生成<ahref="/Products/Detail">all</a>二Html.ActionLink("linkText","actionName 阅读全文
posted @ 2012-11-05 17:08 Raywang80s 阅读(305) 评论(0) 推荐(0)
摘要: 使用绝对路径,不要使用相对路径 <form runat="server" method="get" action=@Url.Content("~/addtools/onpays/alipay/default.aspx") > 阅读全文
posted @ 2012-11-05 15:55 Raywang80s 阅读(144) 评论(0) 推荐(0)
摘要: 使用asp.net 接收html静态页面提交的表单时,接受的函数应使用 this.Request.QueryString["userName"],不能使用string userName = this.Request.Form["userName"].ToString(); 后一种方法会提示“未将对象引用设置到对象的实例”。我的代码如下:html静态页面:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login_xhtml.aspx.c 阅读全文
posted @ 2012-11-05 11:15 Raywang80s 阅读(468) 评论(0) 推荐(1)
摘要: 无法将“Enable-Migrations”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后重试。 所在位置 行:1 字符: 18 + Enable-Migrations <<<< + CategoryInfo : ObjectNotFound: (Enable-Migrations:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException 使用PM> Update-Package命令后 阅读全文
posted @ 2012-11-04 11:22 Raywang80s 阅读(737) 评论(1) 推荐(0)
摘要: C#中调用python脚本1.安装IronPython到http://ironpython.codeplex.com/下载IronPython。安装下载下来的安装包(要先装VS啊)。2.创建项目创建一个C#的控制台应用程序。添加引用:浏览到IronPython的安装目录中,添加对IronPython.dll,Microsoft.Scripting.dll两个dll的引用。3.添加Python文件到当前的项目中创建一个文本文件命名为:hello.py,编辑如下defwelcome(name):return"hello"+name把该文件添加的当前的项目中。4.在C#中调用Py 阅读全文
posted @ 2012-11-01 15:24 Raywang80s 阅读(373) 评论(0) 推荐(0)
摘要: Global文件的RegisterRoutes方法里加入routes.RouteExistingFiles=false;意思是:路由现有的文件设置为false,访问现有的文件就不经过路由了。源代码:publicstaticvoidRegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.RouteExistingFiles=false; routes.MapRoute( "Default",// Route name 阅读全文
posted @ 2012-10-30 11:48 Raywang80s 阅读(271) 评论(0) 推荐(0)
上一页 1 ··· 9 10 11 12 13 14 15 下一页