minor code improvements
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
Imports System.IO
|
||||
|
||||
Imports Newtonsoft.Json.Linq
|
||||
Imports Newtonsoft.Json
|
||||
|
||||
Imports Pilz.Cryptography
|
||||
|
||||
@@ -11,12 +11,12 @@ Public Class UpdateConfig
|
||||
Public Property WebdavUsername As SecureString
|
||||
Public Property WebdavPassword As SecureString
|
||||
|
||||
Public Sub SaveToFile(filePath As string)
|
||||
File.WriteAllText(filePath, JObject.FromObject(Me).ToString)
|
||||
Public Sub SaveToFile(filePath As String)
|
||||
File.WriteAllText(filePath, JsonConvert.SerializeObject(Me))
|
||||
End Sub
|
||||
|
||||
Public Shared Function LoadFromFile(filePath As String) As UpdateConfig
|
||||
Return JObject.Parse(File.ReadAllText(filePath)).ToObject(Of UpdateConfig)
|
||||
Return JsonConvert.DeserializeObject(Of UpdateConfig)(File.ReadAllText(filePath))
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user