Advertisement
Guest User

Untitled

a guest
Jul 16th, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.83 KB | None | 0 0
  1. Sub CheckMachineName()
  2.         Try
  3.             Dim JunkVariable = My.Settings.conDobAlerts ' need to access settings data just once before we can iterate through the settings
  4.             If My.Computer.Name = "ASERVER" Then
  5.                 Console.WriteLine("Changed connection string to use localhost")
  6.                 For Each setting As Configuration.SettingsPropertyValue In My.Settings.PropertyValues
  7.                     Try
  8.                         My.Settings.Item(setting.Name) = setting.PropertyValue.ToString.Replace("jjahost.dyndns.org,1533", "localhost")
  9.                     Catch ex As Exception
  10.                         Console.WriteLine("Couldn't change setting " & setting.Name)
  11.                     End Try
  12.                 Next
  13.             End If
  14.         Catch ex As Exception
  15.             Throw ex
  16.         End Try
  17.     End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement