|
sygatary
- PageAdmin学员
- 99
- 224
- 2010-05-16
|
1#
t
T
发表于 2016-01-26 08:31
|只看楼主
大家好,新下载的企业通3.0版本,.net2.0的,配置好了,但是打不开,报以下错误,麻烦高手们给看看,谢谢! Server Error in '/' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0246: The type or namespace name 'Conn' could not be found (are you missing a using directive or an assembly reference?)
Source Error:
| | | Line 237: return false;Line 238: }Line 239: Conn theconn=new Conn();Line 240: OleDbConnection Myconn= theconn.OleDbConn();//获取Line 241: Md5 jm1=new Md5(); |
Source File: d:\qiyetong\e\install\Install.cs Line: 239
Show Detailed Compiler Output:
c:\windows.0\system32\inetsrv> "C:\WINDOWS.0\Microsoft.NET\Framework\v2.0.50727\csc.exe" /t brary /utf8output /R:"C:\WINDOWS.0\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\WINDOWS.0\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\WINDOWS.0\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll" /R:"C:\WINDOWS.0\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\WINDOWS.0\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\WINDOWS.0\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\WINDOWS.0\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /R:"C:\WINDOWS.0\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"C:\WINDOWS.0\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\WINDOWS.0\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /out:"C:\WINDOWS.0\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\d0fd6c96\f8e73c27\App_Web_install.cs.c29b009d.v-hpwvda.dll" /debug- /optimize+ /w:4 /nowarn:1659;1699;1701 "C:\WINDOWS.0\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\d0fd6c96\f8e73c27\App_Web_install.cs.c29b009d.v-hpwvda.0.cs" "C:\WINDOWS.0\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\d0fd6c96\f8e73c27\App_Web_install.cs.c29b009d.v-hpwvda.1.cs"Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.1433for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.d:\qiyetong\e\install\Install.cs(239,4): error CS0246: The type or namespace name 'Conn' could not be found (are you missing a using directive or an assembly reference?)d:\qiyetong\e\install\Install.cs(239,21): error CS0246: The type or namespace name 'Conn' could not be found (are you missing a using directive or an assembly reference?)d:\qiyetong\e\install\Install.cs(241,4): error CS0246: The type or namespace name 'Md5' could not be found (are you missing a using directive or an assembly reference?)d:\qiyetong\e\install\Install.cs(241,16): error CS0246: The type or namespace name 'Md5' could not be found (are you missing a using directive or an assembly reference?) |
Show Complete Compilation Source:
Line 1: using System;Line 2: using System.Web;Line 3: using System.Web.UI;Line 4: using System.Web.UI.WebControls;Line 5: using System.Web.UI.HtmlControls;Line 6: using System.Data;Line 7: using System.Data.OleDb;Line 8: using System.Configuration;Line 9: using System.IO;Line 10: Line 11: namespace PageAdminLine 12: {Line 13: public class PaInstall ageLine 14: {Line 15: protected TextBox Tb_sql,TbMasterDir,Login_Pass,Login_Pass1;Line 16: protected PlaceHolder Panel1,Panel2,Panel3,Panel4,Panel5;Line 17: protected RadioButton Radio_1,Radio_2;Line 18: protected Label Lbl_error;Line 19: protected Button Setup_1;Line 20: protected string Net_Version,ManageDirectory,masterurl,SERVER_PORT;Line 21: protected string[] r_p,w_p,d_p;Line 22: int Mtype_Id;Line 23: Line 24: protected void Page_Load(Object src,EventArgs e)Line 25: {Line 26: if(check_Installlock())Line 27: {Line 28: if(!Page.IsPostBack)Line 29: {Line 30: Net_Version=Environment.Version.ToString(); Line 31: SERVER_PORT=Request.ServerVariables["SERVER_PORT"]=="80"?"":":"+Request.ServerVariables["SERVER_PORT"];Line 32: switch(Request.QueryString["Setup"])Line 33: {Line 34: Line 35: case "2" ine 36: Panel1.Visible=false;Line 37: Panel2.Visible=true;Line 38: Panel3.Visible=false;Line 39: Panel4.Visible=false;Line 40: Panel5.Visible=false;Line 41: check_permission();Line 42: break;Line 43: Line 44: case "3" ine 45: Panel1.Visible=false;Line 46: Panel2.Visible=false;Line 47: Panel3.Visible=true;Line 48: Panel4.Visible=false;Line 49: Panel5.Visible=false;Line 50: string Str_DbType=ConfigurationManager.AppSettings["DbType"].ToString();Line 51: if(Str_DbType=="1")Line 52: {Line 53: Radio_1.Checked=false;Line 54: Radio_2.Checked=true;Line 55: }Line 56: elseLine 57: {Line 58: Radio_1.Checked=true;Line 59: Radio_2.Checked=false;Line 60: }Line 61: TbMasterDir.Text=ConfigurationManager.AppSettings["ManageDirectory"].ToString().Replace("/e/","").Replace("/","");Line 62: break;Line 63: Line 64: case "4" ine 65: Panel1.Visible=false;Line 66: Panel2.Visible=false;Line 67: Panel3.Visible=false;Line 68: Panel4.Visible=true;Line 69: Panel5.Visible=false;Line 70: break;Line 71: Line 72: default ine 73: Panel1.Visible=true;Line 74: Panel2.Visible=false;Line 75: Panel3.Visible=false;Line 76: Panel4.Visible=false;Line 77: Panel5.Visible=false;Line 78: break;Line 79: Line 80: }Line 81: }Line 82: Line 83: }Line 84: Line 85: }Line 86: Line 87: protected void Next_1(Object src,EventArgs e)Line 88: {Line 89: if(check_Installlock())Line 90: {Line 91: string ThePath=Server.MapPath("/web.config");Line 92: if(!File.Exists(ThePath))Line 93: {Line 94: Lbl_error.Visible=true;Line 95: Lbl_error.Text="错误:请将网站放在根目录下再运行。"; Line 96: Setup_1.Enabled=false;Line 97: return; Line 98: }Line 99: Response.Write("<script>location.href='?setup=2'</script>");Line 100: Response.End();Line 101: }Line 102: }Line 103: Line 104: Line 105: Line 106: protected void Next_2(Object src,EventArgs e)Line 107: {Line 108: if(!check_Installlock()){return;}Line 109: Response.Write("<script>location.href='?setup=3'</script>");Line 110: Response.End();Line 111: }Line 112: Line 113: protected void Next_3(Object src,EventArgs e)Line 114: {Line 115: if(!check_Installlock()){return;}Line 116: Update_Config();Line 117: }Line 118: Line 119: protected void Next_4(Object src,EventArgs e)Line 120: {Line 121: if(!check_Installlock()){return;}Line 122: if(Update_DataBase())Line 123: {Line 124: Lbl_error.Text="";Line 125: ManageDirectory=ConfigurationManager.AppSettings["ManageDirectory"].ToString();Line 126: Panel1.Visible=false;Line 127: Panel2.Visible=false;Line 128: Panel3.Visible=false;Line 129: Panel4.Visible=false;Line 130: Panel5.Visible=true;Line 131: Build_Installlock();Line 132: masterurl=ManageDirectory+"login.aspx";Line 133: }Line 134: }Line 135: Line 136: private void Update_Config()Line 137: { Line 138: string MDir,the_DbType,Url;Line 139: if(Radio_1.Checked)Line 140: {Line 141: the_DbType="0";Line 142: }Line 143: elseLine 144: {Line 145: the_DbType="1";Line 146: }Line 147: MDir=TbMasterDir.Text.Trim();Line 148: if(!IsStr(MDir))Line 149: {Line 150: Lbl_error.Text="错误:请正确设置后台目录,目录只能由字母和下划线组成!"; Line 151: return;Line 152: }Line 153: MDir="/e/"+MDir+"/";Line 154: Url=GetUrl(Request.ServerVariables["SERVER_NAME"]);Line 155: System.Xml.XmlDocument x = new System.Xml.XmlDocument(); Line 156: x.Load(Server.MapPath("/web.Config")); Line 157: System.Xml.XmlNodeList xnlist = x.SelectSingleNode("configuration/appSettings").ChildNodes;Line 158: foreach (System.Xml.XmlNode xn in xnlist) Line 159: { Line 160: System.Xml.XmlElement xe = (System.Xml.XmlElement)(xn); Line 161: switch(xe.Attributes["key"].Value)Line 162: {Line 163: case "DbType" ine 164: if(Request.QueryString["Setup"]=="3")Line 165: {Line 166: xe.Attributes["value"].Value=the_DbType;Line 167: }Line 168: break;Line 169: Line 170: case "Url" ine 171: if(Url!="localhost")Line 172: {Line 173: string current_url=Request.ServerVariables["SERVER_NAME"].ToLower();Line 174: string config_url=ConfigurationManager.AppSettings["ManageDirectory"].ToString().ToLower();Line 175: if(config_url.IndexOf(current_url)<0)Line 176: {Line 177: xe.Attributes["value"].Value=Request.ServerVariables["SERVER_NAME"];Line 178: }Line 179: }Line 180: break;Line 181: Line 182: case "ManageDirectory" ine 183: if(MDir!=ConfigurationManager.AppSettings["ManageDirectory"].ToString())Line 184: {Line 185: if(Directory.Exists(Server.MapPath(ConfigurationManager.AppSettings["ManageDirectory"].ToString())))Line 186: {Line 187: Directory.Move(Server.MapPath(ConfigurationManager.AppSettings["ManageDirectory"].ToString()),Server.MapPath(MDir));Line 188: xe.Attributes["value"].Value=MDir;Line 189: }Line 190: }Line 191: break;Line 192: }Line 193: }Line 194: x.Save(Server.MapPath("/web.Config")); Line 195: Response.Write("<script>location.href='?setup=4'</script>");Line 196: Response.End();Line 197: }Line 198: Line 199: Line 200: private void Check_DefaultType(OleDbConnection Myconn)Line 201: {Line 202: string sql="select * from pa_member_type where m_group='admin'";Line 203: OleDbCommand Comm=new OleDbCommand(sql,Myconn);Line 204: OleDbDataReader dr=Comm.ExecuteReader();Line 205: if(!dr.Read())Line 206: {Line 207: sql="insert into pa_member_type(name,m_reg,m_check,m_group,beizhu) values('管理员组',0,1,'admin','内置组')";Line 208: Comm=new OleDbCommand(sql,Myconn);Line 209: Comm.ExecuteNonQuery();Line 210: }Line 211: Line 212: sql="select * from pa_member_type where m_group='admin'";Line 213: Comm=new OleDbCommand(sql,Myconn);Line 214: dr=Comm.ExecuteReader();Line 215: if(dr.Read())Line 216: {Line 217: Mtype_Id=int.Parse(dr["id"].ToString());Line 218: }Line 219: Line 220: sql="select * from pa_member_type where m_group='defaultusers'";Line 221: Comm=new OleDbCommand(sql,Myconn);Line 222: dr=Comm.ExecuteReader();Line 223: if(!dr.Read())Line 224: {Line 225: sql="insert into pa_member_type(name,m_reg,m_check,m_group,beizhu) values('普通会员',1,0,'defaultusers','内置组')";Line 226: Comm=new OleDbCommand(sql,Myconn);Line 227: Comm.ExecuteNonQuery();Line 228: }Line 229: Line 230: }Line 231: Line 232: private bool Update_DataBase()Line 233: { Line 234: if(Login_Pass.Text!=Login_Pass1.Text)Line 235: {Line 236: Lbl_error.Text="两次输入的密码不一致,请重新输入!";Line 237: return false;Line 238: }Line 239: Conn theconn=new Conn();Line 240: OleDbConnection Myconn= theconn.OleDbConn();//获取Line 241: Md5 jm1=new Md5();Line 242: string Pass=jm1.Get_Md5(Login_Pass.Text.Trim());Line 243: Myconn.Open();Line 244: Check_DefaultType(Myconn);Line 245: string sql="select top 1 * from pa_member where username='admin'";Line 246: OleDbCommand Comm=new OleDbCommand(sql,Myconn);Line 247: OleDbDataReader dr=Comm.ExecuteReader();Line 248: if(dr.Read())Line 249: {Line 250: sql="update pa_member set userpassword='"+Pass+"',m_group='admin',checked=1,mtype_id="+Mtype_Id+" where username='admin'";Line 251: Comm=new OleDbCommand(sql,Myconn);Line 252: Comm.ExecuteNonQuery();Line 253: }Line 254: elseLine 255: {Line 256: sql="insert into pa_member(username,userpassword,m_group,checked,mtype_id,space_clicks,department_id) values('admin','"+Pass+"','admin',1,"+Mtype_Id+",0,0)";Line 257: Comm=new OleDbCommand(sql,Myconn);Line 258: Comm.ExecuteNonQuery();Line 259: }Line 260: Line 261: dr.Close();Line 262: Myconn.Close();Line 263: return true;Line 264: Line 265: }Line 266: Line 267: private bool check_Installlock()Line 268: {Line 269: string ThePath=Server.MapPath("install.lock");Line 270: if(File.Exists(ThePath))Line 271: {Line 272: Panel1.Visible=false;Line 273: Panel2.Visible=false;Line 274: Panel3.Visible=false;Line 275: Panel4.Visible=false;Line 276: Panel5.Visible=false;Line 277: Lbl_error.Text="提示:请先删除/e/install/目录下的install.lock文件后再运行。";Line 278: return false;Line 279: }Line 280: elseLine 281: {Line 282: return true;Line 283: }Line 284: }Line 285: Line 286: private void Build_Installlock()Line 287: {Line 288: FileStream Fs=new FileStream(Server.MapPath("install.lock"),FileMode.Create,FileAccess.Write);Line 289: System.Text.Encoding encoding=System.Text.Encoding.GetEncoding("GB2312"); Line 290: StreamWriter rw=new StreamWriter(Fs,encoding);Line 291: rw.Write("1");Line 292: rw.Flush();Line 293: rw.Close();Line 294: Fs.Close();Line 295: }Line 296: Line 297: private string GetUrl(string Url)Line 298: {Line 299: if(IsLocal(Url) || Url.IndexOf(".")<0)Line 300: {Line 301: return "localhost";Line 302: }Line 303: elseLine 304: { Line 305: return Url.Replace("www.","");Line 306: }Line 307: }Line 308: Line 309: private bool IsLocal(string str)Line 310: {Line 311: string[] LocalIp=new string[]{@"^127[.]0[.]0[.]1$",@"^localhost$",@"^10[.]\d{1,3}[.]\d{1,3}[.]\d{1,3}$",@"^172[.]((1[6-9])|(2\d)|(3[01]))[.]\d{1,3}[.]\d{1,3}$",@"^192[.]168[.]\d{1,3}[.]\d{1,3}$"};Line 312: for(int i=0;i<LocalIp.Length;i++)Line 313: {Line 314: if(System.Text.RegularExpressions.Regex.IsMatch((str==null?"":str),LocalIp))Line 315: {Line 316: return true;Line 317: }Line 318: }Line 319: return false;Line 320: }Line 321: Line 322: private void check_permission()Line 323: {Line 324: r_p=new string[]{"√","√","√","√","√","√","√","√"};Line 325: w_p=new string[]{"<font color=red>X</font>","<font color=red>X</font>","<font color=red>X</font>","<font color=red>X</font>","<font color=red>X</font>","<font color=red>X</font>","<font color=red>X</font>","<font color=red>X</font>"};Line 326: d_p=new string[]{"<font color=red>X</font>","-","<font color=red>X</font>","<font color=red>X</font>","<font color=red>X</font>","<font color=red>X</font>","<font color=red>X</font>","-"};Line 327: string[] paths=new string[]{"/","web.config","/e/d/","/e/zdyform/","/e/zdymodel/","/e/zdytag/","/e/upload/","/e/database/"};Line 328: System.Text.Encoding encoding=System.Text.Encoding.GetEncoding("GB2312");Line 329: FileStream Fs;Line 330: StreamWriter rw;Line 331: string cfiles="";Line 332: for(int i=0;i<paths.Length;i++)Line 333: {Line 334: if(paths=="web.config")Line 335: {Line 336: cfiles=Server.MapPath("/web.config");Line 337: }Line 338: elseLine 339: {Line 340: cfiles=Server.MapPath(paths+"c.txt");Line 341: }Line 342: tryLine 343: {Line 344: if(paths=="web.config")Line 345: {Line 346: Fs=new FileStream(cfiles,FileMode.Append,FileAccess.Write);Line 347: rw=new StreamWriter(Fs,encoding);Line 348: rw.Write("");Line 349: }Line 350: elseLine 351: {Line 352: Fs=new FileStream(cfiles,FileMode.Create,FileAccess.Write);Line 353: rw=new StreamWriter(Fs,encoding);Line 354: rw.Write(paths);Line 355: }Line 356: rw.Flush();Line 357: rw.Close();Line 358: Fs.Close();Line 359: w_p="√";Line 360: } Line 361: catch{}Line 362: Line 363: if(File.Exists(cfiles) && paths!="web.config" && paths!="/e/database/")Line 364: {Line 365: tryLine 366: {Line 367: File.Delete(cfiles);Line 368: d_p="√";Line 369: }Line 370: catch{} Line 371: }Line 372: }Line 373: }Line 374: Line 375: private bool IsStr(string str)Line 376: {Line 377: if(string.IsNullOrEmpty(str)){return false;}Line 378: string str1="abcdefghijklmnopqrstuvwxyz0123456789_";Line 379: string str2=str.ToLower();;Line 380: for(int i=0;i<str2.Length;i++)Line 381: {Line 382: if(str1.IndexOf(str2)==-1)Line 383: {Line 384: return false;Line 385: }Line 386: }Line 387: return true;Line 388: }Line 389: Line 390: Line 391: }Line 392: Line 393: }Line 394: Line 395: |
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
|