Imports System.IO

Public Class ClassHelper
    Public Shared Function CheckDBNull(input As Object, back_Value As String)
        If IsDBNull(input) Then
            If back_Value = "String" Then
                Return ""
            Else
                Return True
            End If
        Else
            If back_Value = "String" Then
                Return input.ToString
            Else
                Return False
            End If
        End If
    End Function
    Public Shared Function Get_TempFilename()
        'Eine tempfile generieren
        Dim tempFilename = My.Computer.FileSystem.GetTempFileName()
        'Nur den Filenamen ohne Erweiterung
        Dim tempName = Path.GetDirectoryName(tempFilename) & "\" & Path.GetFileNameWithoutExtension(tempFilename)
        'tempfile lsöchen
        If My.Computer.FileSystem.FileExists(tempFilename) Then
            My.Computer.FileSystem.DeleteFile(tempFilename)
        End If
        Return tempName
    End Function
End Class
