文章分类 - .NET
有关.NET知识收集
摘要:一、参数的获取:在ASP.NET MVC 中获取当前URL、controller、actionURL的获取很简单,ASP.NET通用:【1】获取完整url(协议名+域名+虚拟目录名+文件名+参数)stringurl=Request.Url.ToString();【2】获取虚拟目录名+页面名+参数:stringurl=Request.RawUrl;(或stringurl=Request.Url.PathAndQuery;)【3】获取虚拟目录名+页面名:stringurl=HttpContext.Current.Request.Url.AbsolutePath;(或stringurl=HttpCo
阅读全文
摘要:1 public static bool smethod_0(ref string string_0) 2 { 3 string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "LvCha.S3.dll"; 4 if (File.Exists(path)) 5 { 6 // ab ab = new ab(); 7 if (/*ab.a()*/true) 8 ...
阅读全文
摘要:最近有一个关于DataGridView删除指定行的小问题困扰着,问题是这样的:DataGridView导入一个xls表格,如下图:现在想将以上表格数据插入数据库,之前是想每成功插入一行数据就在DataGridView里删除一行(即让这行不显示),没有成功插入的不删除(即显示在DataGridView里)1 foreach (DataGridViewRow row in dataGridView1.Rows)2 {3 //这里写插入数据库代码(略)4 dataGridView1.Rows.Remove(row);//删除行 5 }使用以上代码后:最终还是显示两行数据,但查...
阅读全文
摘要:1、数据控件里传递多个值:<a href='../BrowsePost.aspx?smallid=<%#Eval("PostType_Id") %>&postid=<%#Eval("Post_Id") %>'><%#Eval("Post_Title") %></a>2、DropDownList 默认显示项ddl.Items.FindByValue("value值").Selected=true3、SQL varchar中设50个字节
阅读全文