վҳ   ϵ 
վҳ ע ҵʾ ͨ ܽվ ̬ ҵƽ̨  
վҳ
֧ҳ
ռ
ܽվ
ͨ
̬
ѯ
 

   
ʹ��ASP.NET�����������ļ���Ŀ¼��һ�ַ���
ʹ��ASP.NET�����������ļ���Ŀ¼�ж��ַ���������Directory.CreateDirectory��DirectoryInfo.Create�ȷ���������һ��Ŀ¼����������������������һ�ֱȽ�����Ĵ���Ŀ¼�ķ���������ʹ��cmd�����ʽ������

���ù�DOS������˶�֪��DOS����������ܶ��£�����dir�����о�Ŀ¼�µ��ļ�����Ŀ¼����Σ����Ǿ�����ASP.NET����������cmd�������������ļ���
������һ�ε���cmd.exe�ķ�����
public bool cmd(string argm)
{
//��ʼ�����ļ�
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;

try
{
p.Start();
p.StandardInput.WriteLine(argm);
p.StandardInput.WriteLine("exit");
p.StandardOutput.ReadToEnd();
p.Close();
return true;
}
catch
{
return false;
}
}
����argm�DZ�ʾִ�е�cmd���������Ҫ����һ���ļ��У�ʹ�÷������£�
bool created = cmd(@"md e:\abc\mydir");

ʹ��cmd�����ļ���������������£�
�����ļ��� md
ɾ���ļ��� rd
ɾ���ļ� del
�������ļ��� move
�������ļ� rename
�����ļ��� xcopy
�����ļ� copy
�ƶ��ļ����ļ��� move
�� ��
 
  打 印   发 送 时代互联Todaynic.com, Inc. 版权所有 ©2000-2024
《中华人民共和国增值电信业务经营许可证》 ISP证粤B2-20042046