
asp.net
Gerry_
一天一點進步
展开
-
.net 响应form请求
if (Request.Form["name"] != null && Request.Form["tel"] != null) { string name = Request.Form["name"]; string tel = Request.Form["tel"]; if原创 2016-07-12 13:01:58 · 650 阅读 · 0 评论 -
ASP.NET GridView 自增編號
proctected void Gridiew1_RowDataBound(object sender,GridviewRowEventArgs e) { if(e.Row.RowIndex!=-1) { int id=e.Row.RowIndex+1;原创 2015-07-22 06:57:14 · 472 阅读 · 0 评论 -
asp.net 讀寫XML文件
讀取XML內容 XmlDocument xml=new XmlDocument(); xml.Load(Server.MapPath("text.xml")); XmlNode node = xml.SelectSingleNode("root");//根節點 XmlNode nd =原创 2015-07-17 14:54:31 · 379 阅读 · 0 评论 -
C# 控制音量大小
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Runtime.Interop原创 2015-06-24 15:04:51 · 6763 阅读 · 2 评论 -
C# DataGridView手动添加数据
开发环境:VS2008.Net版本:.Net Framework 2.0最终效果图片:源码:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;原创 2015-06-22 15:57:55 · 48474 阅读 · 1 评论 -
C# Oracle分頁完整代碼
開發環境:VS2008.NET版本:.Net Framework2.0using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System原创 2015-06-18 09:59:50 · 563 阅读 · 0 评论 -
C# winfrom 录音
导入API函数: [DllImport("winmm.dll")] public static extern int mciSendString(string lpstrCommand, string lpstrReturnString, int uReturnLength, int hwndCallback);开始录音:原创 2015-06-17 08:35:08 · 3768 阅读 · 0 评论 -
.net webApi
using System;using System.Collections.Generic;using System.Linq;using System.Net;using System.Net.Http;using System.Web.Http;namespace MvcApi.Controllers{ public class ProductController :原创 2016-07-13 16:09:18 · 494 阅读 · 1 评论 -
ASP.NET MD5加密
public ActionResult Index() { string a = CreateMD("zrh"); ViewBag.pw = CreateMD(a); return View(); } public string CreateMD(string password)原创 2016-07-14 15:33:17 · 329 阅读 · 0 评论 -
.net Linq 基础
public ActionResult Index() { //创建DataTable DataTable dt = new DataTable(); DataRow dr = dt.NewRow(); dt.Columns.Add("id", typeof(int));原创 2016-07-14 17:29:13 · 446 阅读 · 0 评论 -
.net Model上下文类
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Data.Entity;using System.ComponentModel.DataAnnotations;using System.ComponentModel;using System.Da原创 2016-07-16 18:08:47 · 1578 阅读 · 0 评论 -
ASP.NET GridView里操作DropDownList
protected void DDL_OnSelectedIndexChanged(object sender, EventArgs e) { DropDownList ddl_pos = (DropDownList)sender; //獲取控件 GridViewRow row_pos = (GridViewRow)ddl_pos.Parent.Parent;原创 2015-08-01 18:27:13 · 857 阅读 · 0 评论 -
ASP.NET導入Excel
public DataSet ExcelToDS(string Path) { try { string strConn = "Provider=Microsoft.Ace.OleDb.12.0;" + "data source=" + Path + ";Extended Properties='Exc原创 2015-08-10 11:20:37 · 419 阅读 · 0 评论 -
asp.net 手動生成一個DataTable
DataTable dt = new DataTable(); DataRow dr; dt.Columns.Add(new DataColumn("Del No", typeof(string))); dt.Columns.Add(new DataColumn("WMS數量", typeof(int))); dt.C原创 2015-08-10 11:25:07 · 458 阅读 · 0 评论 -
.net保存html文件
protected void Button1_Click(object sender, EventArgs e) { string sTitle = "健康專欄第100期"; string html = ""; html += ""; html += ""; ht原创 2016-06-24 14:01:06 · 692 阅读 · 0 评论 -
.net 图片Base64编码
解析图片Base64编码: System.IO.MemoryStream ms = new System.IO.MemoryStream(); System.Drawing.Bitmap bp = new System.Drawing.Bitmap(@"d:\image\splash1.png"); bp.Save(ms,S原创 2016-05-17 15:20:31 · 789 阅读 · 0 评论 -
ASP.NET WebServices注意事项
1.Ajax 跨域问题: 2.使用 JSON JavaScriptSerializer 进行序列化或反序列化时出错。字符串的长度超过了为 maxJsonLength 属性设置的值: 完整的Web.Co原创 2016-04-22 21:48:32 · 440 阅读 · 0 评论 -
ASP.NET程序通过web.config为网站添加MIME
为网站添加MIME类型,可以在IIS中的“MIME类型”设置中添加,但是这样操作网站每次移动到新的服务器或是重新部署环境都需要再重新添加,这里介绍一个一劳永逸的方法,就是在网站的配置文件web.config中添加MIME类型。注:Web.config文件是一个XML文本文件,它用来储存ASP.NETWeb 应用程序的配置信息,通过.NET新建一个Web应用程序后,默认情况下会在根目录自动创建一转载 2016-04-21 17:06:13 · 2385 阅读 · 0 评论 -
.NET 事务处理
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using System.Data.OleDb;namespace Transac原创 2016-02-19 11:20:27 · 343 阅读 · 0 评论 -
.net 讀取DataReader 返回List<T>
public List GetPhoneList() { string sql = "select USER_NAME,PLATFORM,PLATFORM_VERSION,PHONE_MODEL,PHONE_DEVICEID,APP_VERSION,LAST_LOGIN_DATE,ADMIN_ROLE from global_phone_info";原创 2016-01-22 09:25:42 · 925 阅读 · 0 评论 -
.net list<T> 轉DataSet
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;namespace AppPhoneInfo{ public parti原创 2016-01-22 09:22:00 · 475 阅读 · 0 评论 -
.net 確認對話框
<asp:Button ID="btn_reset" runat="server" Text=" 重 置 " OnClick="btn_reset_onclick" OnClientClick="return confirm('重置會將新加的資料全部清空,確定要重置嗎?')" />效果如下:原创 2016-01-05 13:11:04 · 384 阅读 · 0 评论 -
asp.net TreeView綁定數據庫
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data.OleDb;using System.Data;namespace WebApp原创 2015-08-19 10:52:44 · 390 阅读 · 0 评论 -
ASP.NET 操作XML文件,超簡單的方法
XML文件: 4 小華 男 20 1 小張 男 21 2 小瑞 女 22 3 小錦 女 17 ASP.NET代碼:protected void Btn_onclick(object sender, EventA原创 2015-08-14 14:17:58 · 615 阅读 · 0 评论 -
AngularJS 跨域
后台.NET WebApi AngularJS会有跨域问题,jquery 使$.post又正常请求时添加headers:app.controller("ppCtrl", function($scope, $http) { $scope.PostSchoolName = function() { var BaseUrl = "http://localhost:2996/原创 2016-07-19 16:43:19 · 673 阅读 · 0 评论