社区
C#
帖子详情
using Microsoft.Web.UI.WebControls;这个引用我为社么不能用?
zhouxiaochenchina
2003-09-29 06:48:14
我不能用,引用那个组件啊?
还是要装东东?
...全文
37
2
打赏
收藏
using Microsoft.Web.UI.WebControls;这个引用我为社么不能用?
我不能用,引用那个组件啊? 还是要装东东?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
2 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
shixueli
2003-10-02
打赏
举报
回复
你可能要用比如treeview那样的控件,先安装上去了,才能够引用这个名字空间的
junqiang
2003-10-02
打赏
举报
回复
先引用web.dll。
asp.net调用RAR实现文件压缩与解压缩图文代码
如果服务器上安装了RAR程序,那么asp.net可以调用RAR实现文件压缩与解压缩。 不过要注意的是,由于
Web
程序
不能
直接调用客户端的程序(除非用ActiveX,ActiveX几乎被废弃),所以如果要想实现让用户把本地文件用网页解压缩只有把文件上传到服务器上再调用服务器上的RAR压缩,同理要解压缩本地的RAR文件可以把文件上传到服务器解压再拿回来。
using
System;
using
System.Data;
using
System.Configuration;
using
System.
Web
;
using
System.
Web
.Security;
using
System.
Web
.
UI
;
using
System.
Web
.
UI
.
Web
Controls
;
using
System.
Web
.
UI
.
Web
Controls
.
Web
Parts;
using
System.
Web
.
UI
.Html
Controls
;
using
System.IO;
using
System.Runtime.InteropServices;
using
Microsoft
.Win32;
using
System.Diagnostics; public partial class _Default : System.
Web
.
UI
.Page { protected void Page_Load(object sender, EventArgs e) { //清清月儿 http://blog.csdn.net/21aspnet/ } protected void Button1_Click(object sender, EventArgs e) { //压缩 String the_rar;
web
图表模块设计
对数据库中的数据实现各种图表的显示
using
System;
using
System.Collections.Generic;
using
System.Data;
using
System.Data.SqlClient;
using
System.Linq;
using
System.
Web
;
using
System.
Web
.
UI
;
using
System.
Web
.
UI
.
Web
Controls
;
using
Microsoft
.Office.Interop.Owc11; public partial class mianjitu : System.
Web
.
UI
.Page { protected void Page_Load(object sender, EventArgs e) { string ConnectString = "Server=(local);DataBase=
web
;
Ui
d=sa;Pwd=sql"; string Sql = "SELECT month,Allcount FROM Chart"; SqlConnection myConn = new SqlConnection(ConnectString); myConn.Open(); SqlDataAdapter Da = new SqlDataAdapter(Sql, myConn); DataSet ds = new DataSet(); Da.Fill(ds); ………………
ascx使用办法:属性、方法和事件
子,你可以看看 用户控件 usc/dg.ascx <%@ Control Language="c#" AutoEventWireup="false" Codebehind="dg.ascx.cs" Inherits="startmssql.ucs.dg" TargetSchema="http://schemas.
microsoft
.com/intellisense/ie5"%>
usc/dg.ascx.cs namespace startmssql.ucs {
using
System;
using
System.Data;
using
System.Drawing;
using
System.
Web
;
using
System.
Web
.
UI
.
Web
Controls
;
using
System.
Web
.
UI
.Html
Controls
; public class dg : System.
Web
.
UI
.UserControl { protected System.
Web
.
UI
.
Web
Controls
.DataGrid dgsy; private void Page_Load(object sender, System.EventArgs e) { // 在此处放置用户代码以初始化页面 }
C# 数据库访问类 SQLServer 和 Access
using
System;
using
System.Data;
using
System.Configuration;
using
System.Data.OleDb; namespace xxxxx { ///
/// Access数据库访问类 ///
public class DataAccess { private static OleDbConnection conn = new OleDbConnection(); private static OleDbCommand comm = new OleDbCommand(); private static string asscessPath = @".\PoliScan.mdb"; ///
/// 设置Access数据库路径 ///
///
完整的路径字符串 public static void SetAccessPath(string path) { asscessPath = path; } ///
/// 打开数据库 ///
///
成功返回 true;失败返回 false;异常时抛出异常
public static bool OpenConnection() { bool retval = false; if (conn.State != ConnectionState.Open) { conn.ConnectionString = @"Provider=
Microsoft
.Jet.OleDb.4.0;Data Source=" + asscessPath; comm.Connection = conn; try { conn.Open(); if (conn.State == ConnectionState.Open) { retval = true; } } catch (Exception e) { throw new Exception(e.Message); } ............................ ............................
using
System;
using
System.Data;
using
System.Configuration;
using
System.
Web
;
using
System.
Web
.Security;
using
System.
Web
.
UI
;
using
System.
Web
.
UI
.
Web
Controls
;
using
System.
Web
.
UI
.
Web
Controls
.
Web
Parts;
using
System.
Web
.
UI
.Html
Controls
;
using
System.Data.OleDb;
using
System.Data.SqlClient; ///
/// DataBase 的摘要说明 ///
public class DataBase : IDisposable { public DataBase() { // // TODO: 在此处添加构造函数逻辑 // } private SqlConnection con; //创建连接对象 #region 打开数据库连接 ///
/// 打开数据库连接. ///
private void Open() { // 打开数据库连接 if (con == null) { con = new SqlConnection("Data Source = . ;Database = CET ;Integrated Security = SSPI "); } if (con.State == System.Data.ConnectionState.Closed) con.Open(); }
新闻发布系统
using
System;
using
System.Data;
using
System.Configuration;
using
System.Collections;
using
System.
Web
;
using
System.
Web
.Security;
using
System.
Web
.
UI
;
using
System.
Web
.
UI
.
Web
Controls
;
using
System.
Web
.
UI
.
Web
Controls
.
Web
Parts;
using
System.
Web
.
UI
.Html
Controls
;
using
System.Data.OleDb; public partial class userShow : System.
Web
.
UI
.Page { protected void Page_Load(object sender, EventArgs e) { this.Label1.Text = System.DateTime.Now.ToString(); loadData(); } protected void Button2_Click(object sender, EventArgs e) { OleDbConnection conn; OleDbCommand cmd; string olecmd, oleString,value; value = this.TextBox1.Text; Session.Add("key", value); oleString = "Provider=
Microsoft
.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("news.mdb"); olecmd = "select * from userLoad where userName='"; olecmd += TextBox1 .Text.Trim(); olecmd += "'and userPassword='"; olecmd += TextBox2 .Text.Trim() + "'"; conn = new OleDbConnection();//实例化对象 conn.ConnectionString = oleString; cmd = new OleDbCommand(); cmd.Connection = conn; cmd.CommandText = olecmd; conn.Open(); OleDbDataReader dr = cmd.ExecuteReader(); if (this.TextBox1.Text.Trim() == "" || this.TextBox2.Text.Trim() == "") { Response.Redirect("usersub.aspx"); } if (dr.Read()) { Session["username"] = this.TextBox1.Text; Response.Redirect("todayNews.aspx"); } else { this.TextBox1 .Focus(); this.TextBox1 .Text = ""; this.TextBox2 .Text = ""; } conn.Close(); dr.Close(); } protected void Button3_Click(object sender, EventArgs e) { this.TextBox1.Focus(); this.TextBox1.Text = ""; this.TextBox2.Text = ""; } DataSet GetDataSet() { OleDbConnection conn; OleDbCommand cmd; conn = new OleDbConnection(); conn.ConnectionString = "Provider=
Microsoft
.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("news.mdb"); conn.Open(); cmd = new OleDbCommand(); cmd.CommandText = "select * from newsData where newsclassid=0"; cmd.Connection = conn; OleDbDataAdapter oleDA = new OleDbDataAdapter(); oleDA.SelectCommand = cmd; DataSet ds = new DataSet(); oleDA.Fill(ds, "newsData"); conn.Close(); return ds; } void loadData() { DataSet ds = GetDataSet(); GridView1.DataSource = ds; GridView1.DataBind(); } protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { Response.Redirect("userLogin.aspx"); } protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView1.PageIndex = e.NewPageIndex; loadData(); } }
C#
110,536
社区成员
642,578
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章