Click here to Skip to main content
15,892,253 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Getting text from HTML . Pin
Dave Kreskowiak16-Sep-09 8:20
mveDave Kreskowiak16-Sep-09 8:20 
AnswerRe: Getting text from HTML . Pin
0x3c016-Sep-09 6:58
0x3c016-Sep-09 6:58 
GeneralRe: Getting text from HTML . Pin
Tvojemama16-Sep-09 7:04
Tvojemama16-Sep-09 7:04 
GeneralRe: Getting text from HTML . Pin
EliottA16-Sep-09 7:19
EliottA16-Sep-09 7:19 
GeneralRe: Getting text from HTML . Pin
Tvojemama16-Sep-09 7:28
Tvojemama16-Sep-09 7:28 
GeneralRe: Getting text from HTML . Pin
EliottA16-Sep-09 7:29
EliottA16-Sep-09 7:29 
GeneralRe: Getting text from HTML . Pin
0x3c016-Sep-09 9:11
0x3c016-Sep-09 9:11 
QuestionHow to save a dynamic array into text in vb 2008 [modified] Pin
rbjanaki16-Sep-09 5:02
rbjanaki16-Sep-09 5:02 
I have successfully load a dynamic array reading the numbers in a text file into form. But how can I save that array again into text file after I change some numbers.

Private Sub LoadButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoadButton.Click
        Dim lin(8) As String, filRead As StreamReader, i, x, t, d As Integer
        Dim openFile As New OpenFileDialog()
        openFile.Filter = "txt.Files(*.txt)|*.txt"  
        openFile.InitialDirectory = "\C:TextFile1.txt"
        If openFile.ShowDialog() = DialogResult.OK Then
            MessageBox.Show(openFile.FileName)
        End If

        filRead = New StreamReader(openFile.FileName)
        'diff = CByte(filRead.ReadLine())
       
        For r As Integer = 1 To 3
            For rr As Integer = 1 To 3
                lin = filRead.ReadLine.Split() : i = 0
                For c As Integer = 1 To 3
                    For rc As Integer = 1 To 3
                        If lin(i) <> "00" Then
                            x = Integer.Parse(lin(i))
                            If x > 0 Then xx(r, c).rec(rr, rc).ForeColor = Color.Red
                            x = Abs(x)
                            xx(r, c).rec(rr, rc).Text = x.ToString
                            For j As Integer = CInt(Int(Log10(x))) To 0 Step -1
                                If j = 0 Then xx(r, c).val(rr, rc) = CByte(x)
                                t = CInt(10 ^ j)
                                d = x \ t : x = x Mod t
                                xx(r, c).yy(rr, rc, d) = True
                            Next

                        End If
                        i += 1
                    Next
                Next
            Next
        Next

        filRead.Close()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveButton.Click
        Dim lout(8) As String, filsave As Streamwriter, i, x, t, d As Integer
        Dim saveFile As New SaveFileDialog()
        saveFile.Filter = "txt.Files(*.txt)|*.txt"  

        If saveFile.ShowDialog() = DialogResult.OK Then
            MessageBox.Show(saveFile.FileName)
        End If

        filsave = New StreamReader(saveFile.FileName)

        For r As Integer = 1 To 3
            For rr As Integer = 1 To 3
                lout = filsave.
                For c As Integer = 1 To 3
                    For rc As Integer = 1 To 3
                        If lout(i) <> "00" Then
                            x = Integer.Parse(lout(i))
                            If x > 0 Then xx(r, c).rec(rr, rc).ForeColor = Color.Red
                            x = Abs(x)
                            xx(r, c).rec(rr, rc).Text = x.ToString
                            For j As Integer = CInt(Int(Log10(x))) To 0 Step -1
                                If j = 0 Then xx(r, c).val(rr, rc) = CByte(x)
                                t = CInt(10 ^ j)
                                d = x \ t : x = x Mod t
                                xx(r, c).yy(rr, rc, d) = True
                            Next

                        End If
                        i += 1
                    Next
                Next
            Next
        Next
        saveFile.InitialDirectory = ""
        filsave.Close()
    End Sub
End Class


modified on Wednesday, September 16, 2009 10:08 PM

AnswerRe: How to save a dynamic array into text in vb 2008 Pin
Eddy Vluggen16-Sep-09 5:31
professionalEddy Vluggen16-Sep-09 5:31 
Questionhow to find the next number in a form of dynamic array Pin
rbjanaki16-Sep-09 3:28
rbjanaki16-Sep-09 3:28 
AnswerRe: how to find the next number in a form of dynamic array Pin
Dave Kreskowiak16-Sep-09 10:43
mveDave Kreskowiak16-Sep-09 10:43 
QuestionQuestion on GetFiles() [SOLVED] Pin
vijay248216-Sep-09 3:22
vijay248216-Sep-09 3:22 
AnswerRe: Question on GetFiles() Pin
Dave Kreskowiak16-Sep-09 3:51
mveDave Kreskowiak16-Sep-09 3:51 
AnswerRe: Question on GetFiles() [modified] Pin
Nuri Ismail16-Sep-09 3:55
Nuri Ismail16-Sep-09 3:55 
AnswerRe: Question on GetFiles() Pin
Luc Pattyn16-Sep-09 3:57
sitebuilderLuc Pattyn16-Sep-09 3:57 
AnswerRe: Question on GetFiles() Pin
vijay248216-Sep-09 4:20
vijay248216-Sep-09 4:20 
GeneralFormatting code... Pin
dawmail33316-Sep-09 3:03
dawmail33316-Sep-09 3:03 
AnswerRe: Formatting code... Pin
Jay Royall16-Sep-09 3:15
Jay Royall16-Sep-09 3:15 
GeneralRe: Formatting code... Pin
dawmail33316-Sep-09 3:27
dawmail33316-Sep-09 3:27 
GeneralRe: Formatting code... Pin
Ian Shlasko16-Sep-09 3:43
Ian Shlasko16-Sep-09 3:43 
GeneralRe: Formatting code... Pin
dawmail33316-Sep-09 5:04
dawmail33316-Sep-09 5:04 
GeneralRe: Formatting code... Pin
KrisnNala16-Sep-09 23:13
KrisnNala16-Sep-09 23:13 
AnswerRe: Formatting code... Pin
Luc Pattyn16-Sep-09 4:02
sitebuilderLuc Pattyn16-Sep-09 4:02 
GeneralRe: Formatting code... Pin
dawmail33316-Sep-09 5:03
dawmail33316-Sep-09 5:03 
QuestionEmail Pin
Thayhor16-Sep-09 2:55
Thayhor16-Sep-09 2:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.