検索
ホームページphp教程php手册读取磁盘文件 删除

读取磁盘文件 删除

Jun 06, 2016 pm 08:01 PM
phpprotectedvoid消去書類ディスク読む

protected void ReadFile() //读取文件夹,文件 { string savePath = @"common"; StringBuilder outstring = new StringBuilder(); string absSavePath = Server.MapPath(savePath); string[] Directorys = Directory.GetDirectories(absSavePath + @"/" + P

 

    protected void ReadFile()     //读取文件夹,文件

    {

        string savePath = @"common";

        StringBuilder outstring = new StringBuilder();

        string absSavePath = Server.MapPath(savePath);

 

        string[] Directorys = Directory.GetDirectories(absSavePath + @"/" + Page.User.Identity.Name);

        //for (int i = 0; i

        //{

        //    Response.Write(Directorys[i] + "
");

        //}

        //Response.Write("Directorys count:" + Directorys.Length + "个  
---------
");

        string[] Files = Directory.GetFiles(absSavePath + @"" + Page.User.Identity.Name, "*");

 

        outstring.Append("

    ");

     

            for (int i = 0; i

            {

                if (Path.GetFileName(Files[i]) != "Thumbs.db")

                {

                    outstring.Append("

  • 读取磁盘文件  删除
  • ");

                }

            }

            outstring.Append("

");

 

        Response.Write(outstring.ToString());

    }

 

 

//删除文件

 

        string[] strpicname = Request["imgids"].Split(new char[] { ',' });

        for (int i = 0; i

        {

            File.Delete(Server.MapPath(strpicname[i].ToString()));

        }

 

 

//循环遍历复选框

 

    var imgnum = document.getElementsByTagName("input");

    var imgids = "";

    function getpicid()

    {

        document.getElementById("hidimgid").value = "";

        for (var i=0;i读取磁盘文件  删除

        {

            if ( imgnum[i].type == "checkbox" && imgnum[i].name == "picname" && imgnum[i].checked)

            {

                imgids += imgids == "" ? imgnum[i].value : "," + imgnum[i].value;

            }

        }

        document.getElementById("hidimgid").value = imgids;

    }

    

 

声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。

ホットAIツール

Undresser.AI Undress

Undresser.AI Undress

リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover

AI Clothes Remover

写真から衣服を削除するオンライン AI ツール。

Undress AI Tool

Undress AI Tool

脱衣画像を無料で

Clothoff.io

Clothoff.io

AI衣類リムーバー

AI Hentai Generator

AI Hentai Generator

AIヘンタイを無料で生成します。

ホットツール

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

このプロジェクトは osdn.net/projects/mingw に移行中です。引き続きそこでフォローしていただけます。 MinGW: GNU Compiler Collection (GCC) のネイティブ Windows ポートであり、ネイティブ Windows アプリケーションを構築するための自由に配布可能なインポート ライブラリとヘッダー ファイルであり、C99 機能をサポートする MSVC ランタイムの拡張機能が含まれています。すべての MinGW ソフトウェアは 64 ビット Windows プラットフォームで実行できます。

SublimeText3 英語版

SublimeText3 英語版

推奨: Win バージョン、コードプロンプトをサポート!

SublimeText3 中国語版

SublimeText3 中国語版

中国語版、とても使いやすい

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Eclipse を SAP NetWeaver アプリケーション サーバーと統合します。

PhpStorm Mac バージョン

PhpStorm Mac バージョン

最新(2018.2.1)のプロフェッショナル向けPHP統合開発ツール