Hi Is there any easier way to write multiple lines in a file which has things like quotes in and other things like that or is the only way to do it like this
Dim objwriter As New System.IO.StreamWriter(AppsDir & "EthIPChanger.bat")
objwriter.WriteLine("@echo off")
objwriter.WriteLine("netsh interface ip set address name=""" & "Local Area Connection""" & " static " & TB_EthIPAddress.Text & " " & TB_EthSubnetMask.Text & " " & TB_EthDefaultGateway.Text & " 1")
objwriter.WriteLine("netsh interface ip set dns """ & "Local Area Connection""" & " static " & TB_EthDNS1.Text)
objwriter.WriteLine("ipconfig /all > """ & AppsDir & "NetworkInfo.txt""")
objwriter.WriteLine("echo hi > """ & AppsDir & "CheckLen.txt""")
objwriter.Close()
I know if you are using python you can do “”” and then do anything inside that and end it with “””
Does anything like that exist in vb.net?
thanks
If you use objwriter.Write – then you can supply the vbcrlf yourself – and then you can put multiple ‘lines’ in one write statement.
For example: