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 Leute :)

ich brauche dringend eure Hilfe, ich hänge an diesem Problem schon seit Tagen fest und finde einfach keine Lösung dafür :(

Also ich habe einen Ordner, dessen Inhalt auf den FTP hochgeladen werden soll, leider finde ich dazu nichts :(

In meinem bisherigen Code was ich habe lädt er es nur hoch wenn ich eine Datei aus dem Verzeichnnis definiere.



            string Datei;


            Datei = @"Pfad";


            //Create FTP request

            FtpWebRequest request2 = (FtpWebRequest)FtpWebRequest.Create("FTPPfad" + "/" + Path.GetFileName(Datei));


            request2.Method = WebRequestMethods.Ftp.UploadFile;

            request2.Credentials = new NetworkCredential("name", "passwort");

            request2.UsePassive = true;

            request2.UseBinary = true;

            request2.KeepAlive = false;


            //Load the file

            FileStream stream2 = File.OpenRead(Datei);

            byte[] buffer2 = new byte[stream2.Length];


            stream2.Read(buffer2, 0, buffer2.Length);

            stream2.Close();


            //Upload file

            MessageBox.Show("Starten des Uploades der Datei!");

            Stream reqStream2 = request2.GetRequestStream();

            reqStream2.Write(buffer2, 0, buffer2.Length);

            reqStream2.Close();


            MessageBox.Show("Die bestehende Verbindung wurde getrennt/beendet!");


Könnt Ihr mir da helfen?

Danke schon einmal im Vorraus.

MFG PhilippVP

Hey Phillip,


public void UploadDirectory(string directoryPath, string critPattern)

{

     string[] files = System.IO.Directory.GetFiles(directoryPath, critPattern);


     foreach (string file in files)

     {

        UploadFile(Path.Combine(directoryPath, file))

     }

}


public void UploadFile(string filePath)

{

         //do stuff here

}

würds aber auf jedenfall asynchron abarbeiten (Parallel.ForEach, Async/Await, BeginXXX EndXXX, ThreadPool.QueueWorkItem) oder wie auch immer du dir das dann vorstellst.

LG Tobi

Bearbeitet von Jimbo0915

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.