SysSelectDoc.aspx.cs
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:3k
- 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.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- using System.IO;
- public partial class Workflow_SysSelectDoc : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- Response.Buffer = true;
- Response.ExpiresAbsolute = System.DateTime.Now;
- Response.Expires = 0;
- Response.CacheControl = "no-cache";
- if (!IsPostBack)
- {
- string FDir = "c://";
- FDir = Server.MapPath(Request.ServerVariables["PATH_INFO"]);
- FDir = FDir.Substring(0, FDir.Length - (FDir.Split('\').GetValue(FDir.Split('\').Length - 1)).ToString().Length);
- FDir = FDir + "Doc";
- string[] FList;
- string FDirName;
- int starti = 0;
- if (Directory.Exists(FDir) == true)
- {
- FList = Directory.GetFiles(FDir);
- for (Int16 i = 0; i < FList.Length; i++)
- {
- ListItem lst = new ListItem();
- FDirName = FList.GetValue(i).ToString();
- starti = FDirName.Length - (FDirName.Split('\').GetValue(FDirName.Split('\').Length - 1)).ToString().Length;
- lst.Text = FDirName.Substring(starti, FDirName.Length - starti);
- lst.Value = FDirName;
- lbDoc.Items.Add(lst);
- }
- }
- try
- {
- string strM = Convert.ToString(Request.QueryString["StrM"]);
- if (strM.Length > 0 && strM != "undefined")
- {
- ListItem lstk = new ListItem();
- lstk.Text = strM;
- lstk.Value = strM;
- LstDoc.Items.Add(lstk);
- //EtongFlyChouWF EFlyWF = new EtongFlyChouWF();
- //DataView dv = new DataView();
- //dv = EFlyWF.GetActFName(strM);
- //starti = 0;
- //string sDoc;
- //for (int k = 0; k < dv.Table.Rows.Count; k++)
- //{
- // ListItem lstk = new ListItem();
- // sDoc = dv.Table.Rows[k][0].ToString();
- // starti = sDoc.Length - (sDoc.Split('\').GetValue(sDoc.Split('\').Length - 1)).ToString().Length;
- // lstk.Text = sDoc.Substring(starti, sDoc.Length - starti);
- // lstk.Value = sDoc;
- // LstDoc.Items.Add(lstk);
- //}
- }
- }
- catch
- {
- }
- }
- }
- protected void ImgOK_Click(object sender, ImageClickEventArgs e)
- {
- string RetSelectValue = "";
- //HSelectedValue.Value + "|" +
- RetSelectValue = HSelectedText.Value;
- this.ClientScript.RegisterStartupScript(this.GetType(), "", "window.returnValue='" + RetSelectValue + "';window.close();", true);
- }
- }