SysSelectDoc.aspx.cs
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:3k
源码类别:

.net编程

开发平台:

C#

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. using System.IO;
  12. public partial class Workflow_SysSelectDoc : System.Web.UI.Page
  13. {
  14.     protected void Page_Load(object sender, EventArgs e)
  15.     {
  16.         Response.Buffer = true;
  17.         Response.ExpiresAbsolute = System.DateTime.Now;
  18.         Response.Expires = 0;
  19.         Response.CacheControl = "no-cache";
  20.         if (!IsPostBack)
  21.         {
  22.             string FDir = "c://";
  23.             FDir = Server.MapPath(Request.ServerVariables["PATH_INFO"]);
  24.             FDir = FDir.Substring(0, FDir.Length - (FDir.Split('\').GetValue(FDir.Split('\').Length - 1)).ToString().Length);
  25.             FDir = FDir + "Doc";
  26.             string[] FList;
  27.             string FDirName;
  28.             int starti = 0;
  29.             if (Directory.Exists(FDir) == true)
  30.             {
  31.                 FList = Directory.GetFiles(FDir);
  32.                 for (Int16 i = 0; i < FList.Length; i++)
  33.                 {
  34.                     ListItem lst = new ListItem();
  35.                     FDirName = FList.GetValue(i).ToString();
  36.                     starti = FDirName.Length - (FDirName.Split('\').GetValue(FDirName.Split('\').Length - 1)).ToString().Length;
  37.                     lst.Text = FDirName.Substring(starti, FDirName.Length - starti);
  38.                     lst.Value = FDirName;
  39.                     lbDoc.Items.Add(lst);
  40.                 }
  41.             }
  42.             try
  43.             {
  44.                 string strM = Convert.ToString(Request.QueryString["StrM"]);
  45.                 if (strM.Length > 0 && strM != "undefined")
  46.                 {
  47.                     ListItem lstk = new ListItem();
  48.                     lstk.Text = strM;
  49.                     lstk.Value = strM;
  50.                     LstDoc.Items.Add(lstk);
  51.                     //EtongFlyChouWF EFlyWF = new EtongFlyChouWF();
  52.                     //DataView dv = new DataView();
  53.                     //dv = EFlyWF.GetActFName(strM);
  54.                     //starti = 0;
  55.                     //string sDoc;
  56.                     //for (int k = 0; k < dv.Table.Rows.Count; k++)
  57.                     //{
  58.                     //    ListItem lstk = new ListItem();
  59.                     //    sDoc = dv.Table.Rows[k][0].ToString();
  60.                     //    starti = sDoc.Length - (sDoc.Split('\').GetValue(sDoc.Split('\').Length - 1)).ToString().Length;
  61.                     //    lstk.Text = sDoc.Substring(starti, sDoc.Length - starti);
  62.                     //    lstk.Value = sDoc;
  63.                     //    LstDoc.Items.Add(lstk);
  64.                     //}
  65.                 }
  66.             }
  67.             catch
  68.             {
  69.             }
  70.         }
  71.     }
  72.     protected void ImgOK_Click(object sender, ImageClickEventArgs e)
  73.     {
  74.         string RetSelectValue = "";
  75.         //HSelectedValue.Value + "|" + 
  76.         RetSelectValue = HSelectedText.Value;
  77.         this.ClientScript.RegisterStartupScript(this.GetType(), "", "window.returnValue='" + RetSelectValue + "';window.close();", true);
  78.     }
  79. }