摘要:
1.为列表项上传附件Stream fStream = FileUpload1.PostedFile.InputStream;byte[] contents = new byte[fStream.Length]; fStream.Read(contents, 0, (int)fStream.Length);fStream.Close();fStream.Dispose();FileInfo file = new FileInfo(FileUpload1.PostedFile.FileName);SPListItem item = list.GetItemById(itemId);//要给该记录附 阅读全文
摘要:
testList.Sort(delegate(ListEntity.ListGZ v1, ListEntity.ListGZ v2) { return Comparer<int>.Default.Compare(v2.故障延时, v1.故障延时); }); 阅读全文
摘要:
using System.DirectoryServices; IList<ADEntity> entityList = new List<ADEntity>();//保存实体的List集合,作为以后操作的数据源使用 //根据当前域来读取OU=xxx下的所有用户 public IList<ADEntity> ReadAD() { try { System.DirectoryServices.DirectoryEntry entry = new System.Directo... 阅读全文
摘要:
1 //执行插入数据的字符串(含参数) 2 public void ProcInsert(string connStr,string procedureName) 3 { 4 //参数区 5 String conn = connStr;//--连接字符串 6 String procName = procedureName;//--调用的插入的存储过程 7 8 SqlConnection sqlcon = new SqlConnection(conn... 阅读全文
摘要:
SPContext.Current.Site.UpgradeRedirectUri.ToString(); 阅读全文
摘要:
遍历所有控件s1 protected void approval()2 {3 foreach (Control control in this.Page.Controls)4 {5 SetReadOnly(control);6 }7 } 1 //将单个控件包含子集变为只读 2 protected void SetReadOnly(Control ctrl) 3 { 4 if (!ctrl.HasControls()) 5 {... 阅读全文
摘要:
1 string url = SPContext.Current.Web.Url; 2 Uri siteUrl = new Uri(url); 3 using (SPWeb spWeb = new SPSite("http://" + siteUrl.Host).OpenWeb()) 4 { 5 spWeb.AllowUnsafeUpdates = true; 6 //获取CreateNewPro列表信息 7 SPList... 阅读全文
摘要:
1 string a="验证码字符串" 2 string b="要输入的字符串"; 3 if (a.Equals(b, StringComparison.OrdinalIgnoreCase)) 4 { 5 Response.Write("<script>alert('验证码输入成功')</script>"); 6 } 7 else 8 { 9 Response.Write("<script>alert('验证码输入失败')</script>&qu 阅读全文
摘要:
1 Response.Write("<script>alert('没有项目状态');</script>");1 response.write( " <SCRIPT> history.go(-1) </SCRIPT> ") 阅读全文
摘要:
1 ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Music", "StatusNullPro(参数);", true); 阅读全文