- 博客(37)
- 收藏
- 关注
原创 .net控件FreeTextBox使用方法
1.先把freetextbox.dll添加到项目中 2.把 - ftb.colorpicker.aspx - ftb.imagegallery.aspx - ftb.inserttable.aspx 从文件夹HelperScripts复制出来,放到外面与 - test.aspx (测试)同等级目录, (不这么做,插入背景色,图片,表格就不好使) 3.把images文件夹放到test.aspx (测
2005-03-21 18:44:00 1169 1
原创 用ASP.net(c#)上传各种文件的实例
public void uploadFile(object sender , EventArgs E) { //检查上传文件不为空 if(inputFile.PostedFile.ContentLength > 0) { //设定上传文件的保存路径 string strSaveDir = "./upload/"; string strName = inputFile.PostedFile.F
2005-03-21 17:04:00 1815
原创 Asp.net中对象使用的实例
void Page_Load() { pi.Text = Math.PI.ToString(); exp.Text = Math.E.ToString(); } void Update(object sender, EventArgs e) { try { double dblInput = Convert.ToDouble(input.Text); sqrt_input.Text = dbl
2005-03-21 16:52:00 984
原创 Asp.net中使用对象的实例
public class Key { private int shape; public Key(int newshape) { shape = newshape; } public int Shape { get { return shape; } } } public class Car { private string color; private int gear; private i
2005-03-21 16:49:00 812
原创 Asp.net中对像使用继承的方法(:)
public class ScientificCalculator : Calculator { public void SquareRoot() { double root = Math.Sqrt(CurrentValue); Clear(); Add(root); } } public class Calculator { private double currentValue; public
2005-03-21 16:43:00 1166
原创 收集的WEB编程开发常用代码
1. ASP与Access数据库连接: dim conn,mdbfile mdbfile=server.mappath("数据库名称.mdb") set conn=server.createobject("adodb.connection") conn.open "driver={microsoft access driver (*.mdb)};uid=admin;pwd=数据库密码;dbq="
2005-03-21 11:17:00 1382 1
原创 Asp.net中Application的使用
Application state changed successfully Company Telephone =
2005-03-21 10:49:00 1388 1
原创 asp.net中打开文件的方法Response.WriteFile();
Response.WriteFile() string FileName; //make sure the text file is in the correct place. FileName = Request.PhysicalApplicationPath + "demo.asp"; Response.WriteFile(FileName); %>
2005-03-21 10:41:00 3463 1
原创 asp.net中 cookies的应用,自己写的一个简单登陆程序。
public void Page_sub(object Sender,EventArgs e) { if(IsPostBack) { if((username.Text=="netboyc") && (pass.Text=="123456")) { HttpCookie mycook=new HttpCookie("username"); mycook.Value=username.Text;
2005-03-21 10:38:00 1498
原创 Asp.net出错提示"无法找到脚本"/aspnet_client/syste..."解决办法
"无法找到脚本"/aspnet_client/system_web/1_1_4322/WebUIValidation.js"请尝试手动放置或通过运行aspnet_client _C"重新安装"! 点击开始>运行 输入 cmd 然后回车,在DOS界面下输入以下内容 cd C:/winnt/Microsoft.NET/Framework/v1.1.4322 然后回车(其中C:/windows 表示你
2005-03-17 11:24:00 1231 1
原创 ASP.NET环境下完整的treeview使用类
#region 声明//----------------------------------------------------------------------//// 作者: 李淼(Nick.Lee)//// ASP.NET环境下完整的treeview控件使用方案类//// 时间:2005-2-17// boyorgril@msn.com// QQ:16503096////---------
2005-03-17 09:50:00 1002
原创 asp.net使用常见问题
提示错误:分析器错误信息: 在应用程序级别以外使用注册为 allowDefinition=MachineToApplication 的节是错误的。导致该错误的原因可能是在 IIS 中没有将虚拟目录作为应用程序进行配置。或未能加载类型“.........”。解决办法:设置程序目录为虚拟目录出错信息System.Data.OleDb.OleDbException: 操作必须使用一个可更新的查询
2005-03-17 09:41:00 1588
原创 .net中使用Random()产生一个随机数
void Page_load() { Random r = new Random(); int diceRoll = 0; diceRoll = Convert.ToInt32(r.Next(6)) + 1; message1.Text = message1.Text + "Rolled a: " + diceRoll + ""; } Do Loop Example
2005-03-16 13:17:00 3053
原创 .net中使用while语句的使用
void Page_load() { Random r = new Random(); int diceRoll = 0; while (diceRoll != 6) { diceRoll = Convert.ToInt32(r.Next(6)) + 1; message1.Text = message1.Text + "Rolled a: " + diceRoll + ""; } }
2005-03-16 13:07:00 1335
原创 .net中swith,case开关语句的使用
void Page_Load() { if (Page.IsPostBack) { switch(Destination.SelectedItem.Value) { case "Barcelona": Message.Text = "You selected Spains lively Catalan city"; break; case "Oslo": Message.Text = "Ex
2005-03-16 13:05:00 4097
原创 .net中for循环的使用
void Page_Load() { int number, counter; if (Page.IsPostBack) { number = Convert.ToInt32(NumberAttendees.SelectedItem.Value); Message1.Text = ""; for (counter = 0; counter { Message1.Text += "Attende
2005-03-16 13:04:00 4865
原创 .net中函数介绍实例2
void Page_Load() { message1.Text=""; message1.Text+="Calling Function 1..."; Function1(); message1.Text+="Calling Function 2..."; Function2(); message1.Text+="Calling Function 1..."; Function1(); }
2005-03-16 13:03:00 882
原创 .net中if和else的使用
void Page_Load() { int intNumber, intGuess; Random r = new Random(); intNumber = Convert.ToInt32(r.Next(10)) + 1; if (Page.IsPostBack) { intGuess = Convert.ToInt32(Guess.SelectedItem.Value); if (int
2005-03-16 13:02:00 2243
原创 .net中函数的使用实例
string Global ="Hello Im a persistent global variable"; void Page_Load() { message1.Text=""; message1.Text+= Global; message1.Text+="Calling Function 1..."; Function1(); message1.Text+="Calling Fun
2005-03-16 13:00:00 951
原创 .net中函数Function的用法
void Page_Load() { DateTime DueDate; DateTime CheckOutDate; CheckOutDate = DateTime.Now; DueDate = FindDueDate(CheckOutDate); message1.Text = "Your books were checked OUT on " + CheckOutDate; messag
2005-03-16 12:58:00 3683 1
原创 .net中do while的用法
void Page_load() { Random r = new Random(); int diceRoll; do { diceRoll = Convert.ToInt32(r.Next(6)) + 1; message1.Text = message1.Text + "Rolled a: " + diceRoll + ""; } while (diceRoll != 6); }
2005-03-16 12:56:00 5113 1
原创 .net中xml用样式表输出格式
Beginning ASP.NET 1.0 using C# 1-861007-34-5 Chris Ullman .Matt Butler John Kauffman Rob Birdwell Chris Goode Gary Johnson Srinavasa Sivakumar Juan Llib
2005-03-16 12:54:00 1445
原创 .net xml样式表范例
Beginning ASP.NET 1.0 with C# 1-861007-34-5 .Matt Butler Rob Birdwell Ollie Cornes Chris Goode Gary Johnson John Kauffman Ajoy Krishnamoorthy Juan Llib
2005-03-16 12:52:00 1121
原创 .net不同类型的输出格式
void Page_Load() { string CapitalCityOfUK; int NumberOfStates; CapitalCityOfUK = "London"; NumberOfStates = 50; Display1.Text = CapitalCityOfUK; Display2.Text = NumberOfStates.ToString(); } Creat
2005-03-16 12:49:00 902
原创 .net用数组读表单的值
void Page_Load() { string[] strArrayDetails = new string[3]; int intLoop; strArrayDetails[0] = text1.Text; strArrayDetails[1] = text2.Text; strArrayDetails[2] = text3.Text; Message1.Text = strArrayD
2005-03-16 12:08:00 1069
原创 .net数据类型的计算
void Page_Load() { double dblEarn = 150; double dblTax = 23; double dblTotal = dblEarn - ((dblEarn/100)*dblTax); Display1.Text = dblTotal.ToString(); } Declaring Variables Your total earnings a
2005-03-16 12:04:00 786
原创 asp.net(c#)各数据类型的转换,和输出
void Page_Load() { string strEarn = "150"; string strTax = "23.0"; double dblEarn = Convert.ToInt32(strEarn); decimal decTax = Convert.ToDecimal(strTax); double dblTotal = dblEarn - ((dblEarn/100) *
2005-03-16 10:46:00 1216
原创 .net服务器控件,文本框,密码框,文本区域的控件的使用
void Page_Load() { Message1.Text = ""; Message2.Text = ""; Message3.Text = ""; if (text1.Text != "") { Message1.Text = "You have entered the following name: " + text1.Text; } if (text2.Text != "") {
2005-03-16 10:38:00 4112
原创 .net服务器控件,radio列表的使用
void Page_Load() { if (Page.IsPostBack) { Message.Text = "You have selected the following: " + radio1.SelectedItem.Value; } } Radio Button List Example Which city do you wish to look at hote
2005-03-16 10:34:00 1308
原创 ASP.net服务器控件,下拉框使用数组取值
b void Page_Load() { string msg = "You have selected: "; if (list1.Items[0].Selected) { msg = msg + list1.Items[0].Text + ""; } if (list1.Items[1].Selected) { msg = msg + list1.Items[1].Text + ""; }
2005-03-16 10:18:00 1429
原创 web 服务器控件,下拉框控件的使用
void Page_Load() { if (Page.IsPostBack) { Message.Text = "You have selected " + list1.SelectedItem.Value; } } Drop Down List Example Which city do you wish to look at hotels for? Madrid Os
2005-03-16 10:15:00 3670
原创 .net的服务器控件,labe的使用
Label Control page Feiertag Holidays Thank you you have selected to receive information about . The information pack will be sent out within the next 24 hours.
2005-03-16 10:10:00 1168
原创 asp.net(c#)web服务器控件,多选框checkboxlist控件。
void Page_Load() { string msg = "You have selected the following items:"; if (check1.Items[0].Selected) { msg = msg + check1.Items[0].Text + ""; } if (check1.Items[1].Selected) { msg = msg + check1.
2005-03-16 10:08:00 9118 1
原创 asp.net中使用Response.Write和html交叉显示数据
Interweaving ASP.NET code and HTML Example Line1: First HTML Line "); %>Line2: Second HTML Line "); %>Line3: Third HTML Line "); %>
2005-03-16 10:01:00 2946
原创 asp.net(C#)连接xml,显示数据。
void Page_Load() { string xmlFilename = @"D:/aspx/db/artists.xml"; DataSet newDataSet = new DataSet(); newDataSet.ReadXml(xmlFilename); DataGrid1.DataSource = newDataSet; DataGrid1.DataBind(); }
2005-03-16 10:00:00 1120
原创 asp.net(c#)连接ACCESS数据库
void Page_Load(object sender, EventArgs e) { OleDbConnection objConnection; OleDbDataAdapter objCommand; string strConnect; string strCommand; DataSet DataSet1 = new DataSet(); strConnect = @"Prov
2005-03-16 09:48:00 1528
原创 asp.net with c#连接sql 2000数据库
void Page_Load() { string strConnection = "user id=netboyc;password=wd111l;"; strConnection += "initial catalog=aspx;data source=localhost1;"; strConnection += "Connect Timeout=30"; data_src.Text
2005-03-15 09:09:00 1213
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人