Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hallo,

ich bin ein anfänger und programmiere hauptsächlich c#. Programmiere zurzeit an einer Syntax die im dos fenster unterverzeichnisse von C:\ (ich nehme immer diesen Pfad) ausgibt undzwar durch eine Rekursion. Dabei verwende ich noch Win23_Find_data structer.

Der Code:

#include "stdafx.h"

#include "windows.h"


		// Variable Structer

		WIN32_FIND_DATA FindFileData;

		//Funktion Handle

		HANDLE hFind;

		char path2[300];


//path=übrgebenes Argument (der pfad...in diesem Fall immer C:\ )


//WDH=Wiederholung

void WDH(char* path)

{	

	strcpy(path2,path);

	strcat(path2,"*.*");


	FILE_ATTRIBUTE_ARCHIVE;


	//Berechnungsvariablen für die Bytegröße der gefundenen Dateien

	double Sizeof;

	double Sizeof2;


	//FindFirstFile names hFind auf FindFileData

    hFind = FindFirstFile(_T(path2), &FindFileData);


	//Wenn nichts gefunden, error

	 if (hFind == INVALID_HANDLE_VALUE)

		 {

			printf ("Invalid File Handle. Get Last Error reports %d\n", GetLastError ());

		 }


		//Ansonsten Berechnen der Größe, Ausprinten der Datei

	 else

		 {

			// Falls eine erste Datei gefunden wurde, wird nach FindNextFile gesucht

			while(FindNextFile(hFind,&FindFileData)) 

			 { 

				 if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) 

				{ 

					printf("  %s \t\t\t \n\n",FindFileData.cFileName);

				} 

			 }

		  }	


	 strcat (path2,"\\");

	WDH(path2);

}

int _tmain(int argc, _TCHAR* argv[])

{	

	WDH (argv[1]);

	return 0;

}

Meine Idee ist, dass durch den Wiederaufruf der Funktion sich die Variable path2 immer in C:\*.*\.......usw. ändert und er immer weiter in den Unterverzeichnissen mit FindNextFile sucht.

Bestimmt sind auch große Fehler drin, aber ich hoffe ihr seid nicht zu streng^^

Würde gerne wissen wie man diese Idee vervollständigen kann.

thx

Bearbeitet von x-low

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.