Making own Save type dialog
myCoolFile = chosefolder.SelectedPath & "\" & NameofUal.Text & ".Ual"
Try
Dim myCoolWriter As New IO.StreamWriter(myCoolFile, False , [U][I][B]????[/B][/I][/U]) <-<-<-
For i As Integer = 0 To Mainfrm.ShellProgramslis.Items.Count - 1
myCoolWriter.WriteLine(Mainfrm.ShellProgramslis.Items(i).ToString & "~" & Mainfrm.myArrayList(i))
Next
myCoolWriter.Close()
Catch Erroronwrite As Exception
End Try
Ive got some problems how do i say that
thee encoding should look under my combobox of witch one to use(the item that has been chosen):-/
VB 2012
Junior Poster
168 posts since Jul 2010
Reputation Points: 14
Solved Threads: 1
Skill Endorsements: 0
One thing you could do is fill the combobox with all the system.Text.EncodingInfo's and set the combobox's DisplayMember to "DisplayName" and the use the System.Text.Encodings.GetEncoding(Ctype(combox.selecteditem,System.text.EnodingInfo).CodePage) to get the encoding.
An easier way is to make a function to return the encoding based on the combobox's string selected item.
Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim FilePath As String = "C:\No.txt"
Dim FileStreamWriter As New System.IO.StreamWriter(FilePath, False, GetEncoding)
End Sub
Private Function GetEncoding() As System.Text.Encoding
If ComboBoxEncoding.SelectedIndex = -1 Then
Throw New IndexOutOfRangeException()
End If
Select Case CStr(ComboBoxEncoding.SelectedItem)
Case "ASCII"
Return System.Text.Encoding.ASCII
Case Else
Return System.Text.Encoding.Default
End Select
End Function
Unhnd_Exception
Deleted Member
VB 2012
Junior Poster
168 posts since Jul 2010
Reputation Points: 14
Solved Threads: 1
Skill Endorsements: 0
Question Answered as of 2 Years Ago by
Unhnd_Exception