title: Stripping Leading Zero
body: <p>I'm using the code below to set a user PIN in AD extensionAttribute3. This works pefectly well for digits that are 1-9. However, if someone enters zeros first, they are stripped out. Entering zeros after the first digit isn't being stripped, just leading zeros. 
  How can I stop the zero stripping from happening? It would be plausible that someone could set a PIN of 037475, which would be a valid PIN, but would end up getting stripped to 37475.</p>
  
  <pre><code>  Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
          Dim PIN As Integer
          Dim ADName As String = GetLogonName()
          Dim OSlanguage As ADProperties = Language()
          If EnterPIN.Text.Length &lt; 4 Then
              MsgBox(OSlanguage.PINError2, MsgBoxStyle.Exclamation, OSlanguage.PINError1)
              EnterPINLabel.ForeColor = Color.Red
          ElseIf (CheckConsecutiveChars(EnterPIN.Text, 4)) Then
              MsgBox(OSlanguage.PINError3, MsgBoxStyle.Exclamation, OSlanguage.PINError1)
              EnterPINLabel.ForeColor = Color.Red
          Else
              PIN = Integer.Parse(EnterPIN.Text)
              Dim dirEntry As DirectoryEntry = GetDirectoryEntry()
              Dim dirSearcher As DirectorySearcher = New DirectorySearcher(dirEntry)
              dirSearcher.Filter = "(&amp;(objectClass=user)(objectCategory=person)(sAMAccountName=" &amp; ADName &amp; "))"
              dirSearcher.SearchScope = SearchScope.Subtree
              Dim searchResults As SearchResult = dirSearcher.FindOne()
              If Not searchResults Is Nothing Then
                  Dim dirEntryResults As New DirectoryEntry(searchResults.Path)
                  SetADProperty(dirEntryResults, "extensionAttribute3", PIN)
                  dirEntryResults.CommitChanges()
                  dirEntryResults.Close()
                  MsgBox(OSlanguage.Success3, MsgBoxStyle.OkOnly, OSlanguage.Success1)
                  Form1_Load(Me, New System.EventArgs)
              End If
              dirEntry.Close()
          End If
      End Sub
  </code></pre>