Pudge 24 Posted November 10, 2021 Share Posted November 10, 2021 Hey all, who know how you can call this method, using code? Often there is some kind of error in the code, but by the time it is detected, the bot has already closed, and it becomes difficult to find the required log file in the "Logs" folder, when there are thousands of them, if you knew how to call this method, you could make a plugin, allowing you to copy the log when certain errors occur, this would be very useful. Link to comment https://wrobot.eu/forums/topic/13665-copy-log-to-desktop-code/ Share on other sites More sharing options...
Droidz 2738 Posted November 12, 2021 Share Posted November 12, 2021 Hi, it is code: private void ButtonCopyLog(object sender, System.Windows.RoutedEventArgs e) { try { var logFilePath = $@"{Others.GetCurrentDirectory}\Logs\{Logging.NameCurrentLogFile()}"; var logCopyDest = $@"{Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)}\{Logging.NameCurrentLogFile()}"; if (File.Exists(logCopyDest)) File.Delete(logCopyDest); File.Copy(logFilePath, logCopyDest); Logging.Write("[Logging]" + Logging.NameCurrentLogFile() + " copied on your desktop."); } catch { } } Pudge 1 Link to comment https://wrobot.eu/forums/topic/13665-copy-log-to-desktop-code/#findComment-64036 Share on other sites More sharing options...
Pudge 24 Posted November 15, 2021 Author Share Posted November 15, 2021 On 11/12/2021 at 2:53 PM, Droidz said: Hi, it is code: private void ButtonCopyLog(object sender, System.Windows.RoutedEventArgs e) { try { var logFilePath = $@"{Others.GetCurrentDirectory}\Logs\{Logging.NameCurrentLogFile()}"; var logCopyDest = $@"{Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)}\{Logging.NameCurrentLogFile()}"; if (File.Exists(logCopyDest)) File.Delete(logCopyDest); File.Copy(logFilePath, logCopyDest); Logging.Write("[Logging]" + Logging.NameCurrentLogFile() + " copied on your desktop."); } catch { } } Thank you very much, this is what I need Link to comment https://wrobot.eu/forums/topic/13665-copy-log-to-desktop-code/#findComment-64053 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now