using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using System.IO; namespace BusinessMonthPlan { /// <summary> /// WebForm4 の概要の説明です。 /// </summary> public class WebForm4 : System.Web.UI.Page { protected System.Web.UI.WebControls.ListBox FileList; protected System.Web.UI.WebControls.Button Button1; protected System.Web.UI.WebControls.Button Button2; protected System.Web.UI.WebControls.Button Button3; protected string CurrentPath; private void Page_Load(object sender, System.EventArgs e) { if(Page.IsPostBack==false) { CurrentPath= @"c:\UserDir"; //?置当前目? int aa=CurrentPath.IndexOf("."); if(Directory.Exists(@"c:\UserDir")==false) //若?目?不存在,?建?目? Directory.CreateDirectory(@"c:\UserDir"); LoadDir(CurrentPath); //初始化装入目? } } private void LoadDir(string FullPath) { CurrentPath=FullPath; ArrayList values = new ArrayList(); string [] MyFiles,MyDirs; MyFiles = Directory.GetFiles(FullPath); //得到?目?下所有文件 if(CurrentPath!=@"c:\UserDir") //若不是??目?,增加“返回上?目?”?? values.AddRange(MyFiles); //加入文件 MyDirs= Directory.GetDirectories(FullPath); //得到?目?下所有目? values.AddRange(MyDirs); //加入目? FileList.DataSource=values; //?置数据源 FileList.DataBind(); //?定数据 } private void Button1_Click(object sender, System.EventArgs e) { //if(FileList.SelectedItem.Text=="返回上?目?") //返回上?目? //{ //string ParentPath1=Directory.GetParent(CurrentPath).ToString(); string ParentPath=this.FileList.SelectedItem.Text.ToString(); Session["aa"]=ParentPath; LoadDir(ParentPath); return; //} //else //打?目? } private void Button2_Click(object sender, System.EventArgs e) { //string aa=1; //string ParentPath=this.FileList.SelectedItem.Text.ToString(); string aa; aa=Directory.GetCurrentDirectory().ToString(); string ParentPath1=Directory.GetParent(aa).ToString(); LoadDir(ParentPath1); return; } private void Button3_Click(object sender, System.EventArgs e) { //string ParentPath=this.FileList.SelectedItem.Text.ToString(); string aa; aa=@"C:\UserDir\aa\新しいフォルダ"; string ParentPath1=Directory.GetParent(Session["aa"].ToString()).ToString(); Session["aa"]=ParentPath1; LoadDir(ParentPath1); return; } private void FileList_SelectedIndexChanged(object sender, System.EventArgs e) { string ParentPath=this.FileList.SelectedItem.Text.ToString(); Session["aa"]=ParentPath; LoadDir(ParentPath); return; } } }
发表评论
-
转载:jquery webservice 跨域
2013-01-28 16:06 1254现在的JQuery中$.ajax方法支持跨域读取json数 ... -
excel 导入导出
2011-10-27 10:32 834excel 导入导出 -
仿google 日历
2011-08-24 23:10 866仿google 日历仿google 日历仿google 日历仿 ... -
DataTime.ToString("xx")
2011-08-12 13:57 1150//2008年4月24日 System.DateTi ... -
ASP.Net 文件上传大小限制IIS7
2011-08-11 09:41 2657ASP.Net 文件上传大小限制解决方案修改IIS7/ ... -
Request
2011-07-12 17:08 931Request.params、Request、Request. ... -
ASP.NET MVC 第五回 ActionResult的其它返回值
2011-06-21 15:38 1800ASP.NET MVC 第五回 ActionResult的 ... -
dbhelper table扩展
2011-06-15 11:00 691dbhelper table扩展 -
C#扩展对象的方法,this关键字
2011-06-15 10:58 1200namespace ConsoleApplication2 ... -
asp.net mvc2.0的Areas多级文件夹问题
2011-06-15 10:53 1319此文只写给遇到同样问题的人看的,因此写得会有点短 ... -
WCF实例(基于TCP协议的配置)
2011-01-10 17:52 1081WCF实例(基于TCP协议的配置) 启动ServerHost ... -
反射机制
2010-06-24 09:39 828反射的定义:审查元 ... -
委托线程
2010-06-24 09:37 767本系列教程主要包括如下内容:1. BeginInvoke ... -
读写图片
2008-11-12 17:33 888<%@ Import Namespace="S ... -
asp.net 自定义web控件
2008-11-11 15:34 832<%@ Register TagPrefix=&quo ... -
PDF-activereport
2008-09-11 13:36 1445using System; using System.Coll ... -
xml read -write -update -remove
2008-08-19 14:05 989<?xml version="1.0" ... -
web。config
2008-06-27 10:41 763一、认识Web.config文件 网管下载dl.bitscn. ... -
Application,Session,Cookie,ViewState,Cache
2008-06-26 18:20 1591Application 1. Applicat ... -
构造数据源
2008-06-25 13:23 824DataTable dgTable2=new DataTabl ...
相关推荐
error C1083: 无法打开包括文件:“gl\GLAux.h”: No such file or directory 原来是:#include 出错 ==================================================== 解决方法如下: 1:下载此资源包 2:【glaux.dll】 复制...
npm install read-file-tree 用法 var readFileTree = require ( 'read-file-tree' ) readFileTree ( '/path/to/directory' , function ( err , tree ) { console . log ( tree ) } ) 原料药 readFileTree(basedir...
// looping until we reach the end of the file (when read() returns // -1). Note the combination of assignment and comparison in this // while loop. This is a common I/O programming idiom. while(...
Covers how to back up Active Directory, perform authoritative and nonauthoritative restores, check DIT file integrity, perform online and offline defrags, and search for deleted objects. Chapter 17, ...
在oracle中utl_file包提供了一些操作... –给用户授权 grant read, write on directory TESTFILE to zxx; 详细介绍 http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_file.htm 2.写入操作 代码如下
FTP Library Routines Release 4.0 ...FtpRead() - Read from remote file or directory FtpWrite() - Write to remote file FtpClose() - Close data connection Utilities qftp - Command line ftp utility
1.1 READ 1.2 STRINGS 1.3 HASH 1.4 TIMESTAMP 1.5 GET_RUNTIME_DEPENDENCIES 2. 写(Writing) 2.1 WRITE和APPEND 2.2 TOUCH和TOUCH_NOCREATE 2.3 GENERATE 2.4 CONFIGURE 3....
UTC [main] main -> ERRO 001 Cannot run peer because error when setting up MSP from directory Error:can't read the block:&{SERVICE_UNAVAILABLE} Error:Error endorsing chaincode:rpc error:code = ...
Given that the current directory is empty, and that the user has read and write privileges to the current directory, and the following: 1. import java.io.*; 2. public class Maker{ 3. public static...
File Should Not Exist, Directory Should Exist , Directory Should Not Exist 2.2 List Directory, List Files In Directory , List Directories In Directory 2.3 Put Directory ,Get Directory,Put File,Get ...
PEfile.Read(&ImpDescriptor;,20); if (ImpDescriptor.Name==NULL) { break; } else { NameRaw=ImpDescriptor.Name-ImpRVA+ImpRaw; PEfile2.Seek(NameRaw,CFile::begin); for(j=0;j;j++){ PEfile2.Read(&...
exlude files/directories from the specified exclude file, one file/directory per line. If an exclude file/directory is absolute (i.e. prefixed with /, ../, or ./) the entry is treated as absolute, ...
named ReadIP0802.pch and a precompiled types file named StdAfx.obj. Resource.h This is the standard header file, which defines new resource IDs. Microsoft Visual C++ reads and updates this file....
If target is a directory, tcp will copy source into this directory. EXAMPLES The following examples show common usage: tcp file1 file2 tcp file1 dir tcp file1 dir/file2 tcp file1 dir/subdir/subsubdir/...
If target is a directory, tcp will copy source into this directory. EXAMPLES The following examples show common usage: tcp file1 file2 tcp file1 dir tcp file1 dir/file2 tcp file1 dir/subdir/subsubdir/...
是在官方的SDK下进行简单的添加TCP协议。实现TCP连接服务器。
SQL> grant read,write on directory external_2 to hr; 3. sql>conn hr/hr 4. 创建外部表 create table extab_test3 (id number,name varchar2(20)) organization external (type oracle_loader default ...
2. Move the dll file to the program directory missing the file. 3. If step 2 doesn't work. Move mqrt.dll to the system directory. Windows Install - Windows 95,98, and Me - C:\Windows\System - ...
SQUASHFS 2.2 - A squashed read-only filesystem for Linux ...exlude files/directories from the specified exclude file, one file/directory per line. If an exclude file/directory is absolute (i.e. prefixed...
ZipInputStream s = new ZipInputStream(File.OpenRead(filePath1)); ZipEntry theEntry; while ((theEntry = s.GetNextEntry()) != null) { string fullname = Server.MapPath("ziptemp/" + urlid + "/" + the...