Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
//**************************************
// Name: Directory Listing for Windows
// Description:Displays a list of files
// and subdirectories in a directory.
// By: koby-GR
//This code is copyrighted and has
// limited warranties.Please see
//http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=6790&lngWId=3
//for details.
//**************************************
/* Directory Listing for Windows by koby
*http://www.codecraft.tk
*
* Displays a list of files and subdirectories in a directory.
* Usage : ls [drive:][path] Specifies drive and/or directory to list.
* Copyright (c) 2003
* koby and www.CodeCraft.tk. All rigths reserved
* Redistributions of source code must retain the above copyright
* notice and the following disclaimer.
*
* this SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
*ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
*IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS for A PARTICULAR PURPOSE
*ARE DISCLAIMED.
*/
#include <stdio.h>
#include <string.h>
#include <windows.h>
void ls(char *path);
int main(int argc, char *argv[]) {
char path[MAX_PATH];
if(argc==2) {
strcpy(path, argv[1]);
}
else {
GetCurrentDirectory(MAX_PATH, path);
}
ls(path);
return 0;
}
void ls(char *path) {
WIN32_FIND_DATA FindFileData;
HANDLE hFind;
char VolumeName[MAX_PATH], FileSys[5];
int VolSerNum;
GetVolumeInformation(NULL, VolumeName, MAX_PATH, &VolSerNum, NULL, NULL, FileSys, 5);
printf(" Volume in drive %c is %s\n", 64+getdrive(), VolumeName);
printf(" File System is %s\n", FileSys);
printf("\n Directory of %s\n\n", path);
strcat(path, "\\*");
hFind=FindFirstFile(path, &FindFileData);
do {
printf("%*s", 30, FindFileData.cFileName);
if( FindFileData.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY )
printf("\t<DIR>");
if( FindFileData.dwFileAttributes == FILE_ATTRIBUTE_HIDDEN )
printf("\t<Hidden>");
if( FindFileData.dwFileAttributes == FILE_ATTRIBUTE_COMPRESSED )
printf("\t<Compressed>");
if( FindFileData.dwFileAttributes == FILE_ATTRIBUTE_SYSTEM )
printf("\t<System>");
if( FindFileData.dwFileAttributes == FILE_ATTRIBUTE_ENCRYPTED )
printf("\t<Encrypted>\n");
else
printf("\n");
}while ( FindNextFile(hFind, &FindFileData) );
FindClose(hFind);
}