KOCATEPE

Visitors Counter

44352
TodayToday11
YesterdayYesterday21
This_WeekThis_Week11
This_MonthThis_Month259
All_DaysAll_Days44352
Highest 09-13-2024 : 81
216Dot73Dot217Dot1
UNITED STATES
US

Home

first avaliable drive

  • Print
Details
Written by Super User
Category: Visual Studio
Published: 23 October 2020
Hits: 3542

  Public Declare Function WNetAddConnection2 Lib "mpr.dll" Alias "WNetAddConnection2A" (ByRef lpNetResource As NETRESOURCE, ByVal lpPassword As String, ByVal lpUserName As String, ByVal dwFlags As Integer) As Integer

    Public Function firstavaliabledrive() As Char
        Dim drives As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        Dim existingdrives() As DriveInfo = DriveInfo.GetDrives()

        For Each drv In existingdrives
            drives = drives.Replace(drv.ToString.Replace(":\", ""), "")
        Next
        For i As Integer = drives.Length - 1 To 0 Step -1
            If Not IO.Directory.Exists(drives(i) & ":\") Then
                Return drives(i)
                Exit For
            End If
        Next

    End Function

mail validation

  • Print
Details
Written by Super User
Category: Visual Studio
Published: 23 October 2020
Hits: 3200

    Private Sub txt_mail_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles txt_mail.Validating

        If txt_mail.Text <> String.Empty Then

            reg = New Regex("^[_a-z0-9-]+(.[a-z0-9-]+)@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,4})$")
            If Not reg.IsMatch(txt_mail.Text) Then
                EP_Error.SetError(txt_mail, "not  Mail!")
                EP_Ok.SetError(txt_mail, "")
                e.Cancel = True
            Else
                EP_Error.SetError(txt_mail, "")
                EP_Ok.SetError(txt_mail, "OK")
            End If

            reg = Nothing

        End If

    End Sub

Login Form

  • Forgot your username?
  • Forgot your password?

Back to Top

© 2025 KOCATEPE