asp.net 权限设置
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
/// <summary>
/// Pub 的摘要说明
/// </summary>
public static class Pub
{
//对应一个公共类
//得到是否有模块权限方法
// 11111111;10001111 第一段就代表合同,第二段代表仪表
public static bool bModuleRole(string strRole, string ModuleType)
{
string[] ArryRole=strRole.Split(';');
string subRole = "00000000";
switch (ModuleType)
{
case "ht":
subRole = ArryRole[0];
break;
case "yb":
subRole = ArryRole[1];
break;
}
//如果全部是零,那么没权限
if (int.Parse(subRole)>0)
{
return true;
}
else
{
&nbs
相关文档:
//private string datapatch = ConfigurationSettings.AppSettings["acessconn"];//数据库地址
private string datapatch = "db/global.asa";//数据库地址
///
/// 取得dataset
//
/// 查询语句
///
public DataSet GetDataSet(string Commandtext)
{&nbs ......
会ajax的飘过
看论坛里好多人在找后台获取js表格的数据,就把以前的方法放在这里了
前台:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xht ......
cs文件:
using System.IO;
string context = "";
string path = HttpContext.Current.Server.MapPath("") + "\\test\\test.html";
System.Text.Encoding code = System.Text.Encoding.GetEncoding("utf-8");
Stre ......
*
* 使用说明:1. 在Application_Start()中启动定时器(定时清空错误信息):ErrorManager.Instance.Start(),
* 默认12小时运行一次,或用ErrorManager.Instance.SetTim ......
aspx页:
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" CssClass="b">
<asp:ListItem Value="5">5 per page</asp:ListItem ......