Systemdaten und Screenshot in Temp-Ordner

This commit is contained in:
2023-11-23 16:11:55 +01:00
parent 52cc8e0bde
commit c046e4c082
2 changed files with 6 additions and 6 deletions

View File

@@ -547,11 +547,11 @@ Public Class cProgramFunctions
graph = Graphics.FromImage(screenshot)
graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy)
' PictureBox1.Image = screenshot
If Not My.Computer.FileSystem.DirectoryExists(My.Computer.FileSystem.SpecialDirectories.Desktop & "\Screenshots_" & My.Application.Info.AssemblyName & "\") Then
My.Computer.FileSystem.CreateDirectory(My.Computer.FileSystem.SpecialDirectories.Desktop & "\Screenshots_" & My.Application.Info.AssemblyName & "\")
If Not My.Computer.FileSystem.DirectoryExists(My.Computer.FileSystem.SpecialDirectories.Temp & "\Screenshots_" & My.Application.Info.AssemblyName & "\") Then
My.Computer.FileSystem.CreateDirectory(My.Computer.FileSystem.SpecialDirectories.Temp & "\Screenshots_" & My.Application.Info.AssemblyName & "\")
End If
Dim cnt As Integer = 1
Dim strname As String = My.Computer.FileSystem.SpecialDirectories.Desktop & "\Screenshots_" & My.Application.Info.AssemblyName & "\" & form.Name & "_" & Now.ToString("ddMMyyyy_HHmm_")
Dim strname As String = My.Computer.FileSystem.SpecialDirectories.Temp & "\Screenshots_" & My.Application.Info.AssemblyName & "\" & form.Name & "_" & Now.ToString("ddMMyyyy_HHmm_")
While System.IO.File.Exists(strname & cnt & ".bmp") : cnt += 1 : End While
screenshot.Save(strname & cnt & ".bmp")
Return strname & cnt & ".bmp"