Private sub SynchroneProzedur
' ...
' Asynchrone Funktion innerhalb:
Dim t As Task = Task.Run(Async Function()
' ...
End Function)
t.Wait()
.Dispose()
Kategorie: .NET
-
Eine asnychrone Funktion innerhalb einer synchronen aufrufen
-
Entity Framework Package Manager Console Befehle
Add-Migration InitialCreate Update-Database Remove-Migration Update-Database LastGoodMigration Script-Migration
-
Teamprojekt aus Azure DevOps löschen
Folgender Befehl löscht UNWIDERRUFLICH ein Projekt aus Azure DevOps.
Sollte man ein Projekt in der Weboberfläche von Azure DevOps bereits gelöscht haben und dieses nun mit einer GUID in VisualStudio wiederfinden, so ist diese GUID im Projektnamen zu verwenden.
Achtung: das führende große „D“ ist in der GUID zu entfernen:
cd C:\Program Files (x86)\Microsoft Visual Studio17\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer tf.exe destroy $/483bb7b9-b159-441b-a9cd-8758c60c38e3 /collection:https://dev.azure.com/[OrganizationName]
-
Prüfen, ob ein String einen Integer enthält
Dim childAgeAsInt As Integer If Integer.TryParse(childAge, childAgeAsInt) Then ' childAge successfully parsed as Integer Else ' childAge is not an Integer End I
Quelle: https://stackoverflow.com/questions/13980538/check-if-a-string-variable-has-an-integer-value
-
Dateien inkl. Unterverzeichnissen kopieren
Public Sub CopyDirectory(ByVal sourcePath As String, ByVal destinationPath As String) Dim sourceDirectoryInfo As New System.IO.DirectoryInfo(sourcePath) ' If the destination folder don't exist then create it If Not System.IO.Directory.Exists(destinationPath) Then System.IO.Directory.CreateDirectory(destinationPath) End If Dim fileSystemInfo As System.IO.FileSystemInfo For Each fileSystemInfo In sourceDirectoryInfo.GetFileSystemInfos Dim destinationFileName As String = System.IO.Path.Combine(destinationPath, fileSystemInfo.Name) ' Now check whether its a file or a folder and take action accordingly If TypeOf fileSystemInfo Is System.IO.FileInfo Then System.IO.File.Copy(fileSystemInfo.FullName, destinationFileName, True) Else ' Recursively call the mothod to copy all the neste folders CopyDirectory(fileSystemInfo.FullName, destinationFileName) End If Next End Sub
-
Visualisierung von SQL Joins
Quelle: https://www.codeproject.com/articles/33052/visual-representation-of-sql-joins
-
vb.net Zahl mit führenden Nullen formatieren
Dim yourNumber as Int32 = 5 yourNumber.ToString("D2") '= "05"