codeorder 197 Nearly a Posting Virtuoso

See if this helps. (code originated from here)

Public Class Form1

    Private Declare Function GetDC Lib "user32" (ByVal hwnd As Integer) As Integer
    Private Declare Function InvalidateRect Lib "user32" (ByVal hwnd As IntPtr, ByVal lpRect As IntPtr, ByVal bErase As Boolean) As Boolean
    Private WithEvents myTimer As New Timer With {.Interval = 100, .Enabled = True}

    Private Sub drawOnDesktop()
        Dim HDC As Integer = GetDC(0)
        Dim myGraphics As Graphics = Graphics.FromHdc(HDC)
        Dim myPen As New Pen(Color.Chartreuse, 30) '// set pen color and width.
        myGraphics.DrawLine(myPen, 150, 255, 650, 255) '// (preset pen, startLocation.X, startLocation.Y, endLocation.X, endLocation.Y)
        myGraphics.DrawLine(myPen, 150, 355, 650, 355) '// (preset pen, startLocation.X, startLocation.Y, endLocation.X, endLocation.Y)
        myGraphics.Dispose()
    End Sub

    Private Sub myTimer_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles myTimer.Tick
        Me.drawOnDesktop()
    End Sub

    Private Sub clearDesktopDrawing()
        InvalidateRect(IntPtr.Zero, IntPtr.Zero, False)
    End Sub

    Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        Me.clearDesktopDrawing()
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

:)

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

codeorder 197 Nearly a Posting Virtuoso

See if this helps for the "second part".

Sub bckWrd(ByVal x() As Integer, ByVal y() As Integer, ByVal sr As IO.StreamReader)
        sr = IO.File.OpenText("D:\digits.txt") '///opens file
        Dim count As Integer = 0
        Do Until (count = 10)
            x(count) = sr.ReadLine
            '//////////// -- ListBox.Items.Add Code Removed.
            count += 1 '// added last.
        Loop
        '/////////////////////////-- loop thru all of the x arrays backwards.
        For i As Integer = 9 To 0 Step -1
            ListBox1.Items.Add(x(i)) '// add x(array number)
        Next
        '////////////////////////
    End Sub

I used the same code that you use for the

Sub read(ByRef x() As Integer, ByRef sr As IO.StreamReader)

with just a few slight modifications.

If you do not want to use a "For/Next" loop, you can replace it in the above code with a "Do Until/Loop".

'/////////////////////////-- loop thru all of the x arrays backwards.
        count = 9
        Do Until count = 0
            ListBox1.Items.Add(x(count))
            count -= 1 '// added last.
        Loop
        '////////////////////////
codeorder 197 Nearly a Posting Virtuoso

Since the pages you want to retrieve data from are in total of over 15 thousand, I would use Net.HttpWebResponse to retrieve the innerHtml of a web-page instead of using a WebBrowser.
This way you do not overload your Temporary Internet Files folder with Files that you have no use for.

Using Net.HttpWebResponse, you should be able to locate and extract the IDs and also extract the Total Pages from that first page.
Then just add +=1 and extract next page until you are at the Total number of pages available.

codeorder 197 Nearly a Posting Virtuoso

See if this helps for "the first part".

Public Class Form1
    '/////////////////////////////-- array for 10 Integers.
    Dim x(9) As Integer '///Array for the numbers is order
    '//////////////////////////
    Dim y() As Integer '///array for the reversed numbers
    Dim z() As Integer '///array for the average
    Dim sr As IO.StreamReader

    Sub read(ByRef x() As Integer, ByRef sr As IO.StreamReader)

        sr = IO.File.OpenText("D:\digits.txt") '///opens file
        Dim count As Integer = 0

        Do Until (count = 10)
            x(count) = sr.ReadLine
            ListBox1.Items.Add(x(count)) '///Display x value 
            '///////////////////////////
            count += 1 '// added last.
            '/////////////////////////
        Loop

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        read(x, sr)
    End Sub

End Class
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

For Each myCoolTab As TabPage In TabControl1.TabPages
            ListBox1.Items.Add(myCoolTab.Text)
        Next
codeorder 197 Nearly a Posting Virtuoso

...Why the "The login is wrong!" is appearing?...

The reason is because you are not logged in when you first load that web-page.

See if this helps about checking if you have already attempted to Log In.

Private websiteAlreadyAccessed As Boolean = False '// determine if webpage has been accessed.

    Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        If WebBrowser1.Url.AbsoluteUri = "https://steamcommunity.com/login/" Then
            WebBrowser1.Document.GetElementById("steamAccountName").SetAttribute("Value", "gogost")
            WebBrowser1.Document.GetElementById("steamPassword").SetAttribute("Value", "gogost")
            WebBrowser1.Document.Forms(1).InvokeMember("submit")
        End If

        If Me.WebBrowser1.DocumentText.Contains("LogOut") Then
            MsgBox("The login is ok!")
        Else
            '// check if web-page has been visited and display result if there was already an attempt to LogIn.
            If websiteAlreadyAccessed = True Then MsgBox("The login is wrong!")
        End If
        websiteAlreadyAccessed = True '// set to True once first loading the web-page.
    End Sub
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Dim startDate As Date = "10/09/10" '// preset Start Date.
        Dim endDate As Date = "10/25/10" '// preset End Date.
        Dim tempDate As Date = "10/23/10" '// Date that is currently being searched and compared to Start/End Dates.
        If tempDate > startDate And tempDate < endDate Then '// check if greater than startDate and lower than endDate.
            MsgBox("Date matches the preset time span.", MsgBoxStyle.Information)
        Else
            MsgBox("Incorrect Date located.", MsgBoxStyle.Critical)
        End If
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1

    Private myCoolFile As String = "C:\test.txt" '// your File to Save/Load from.

    Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        '//------ Save File ------------------------------------------\\
        Dim myWriter As New IO.StreamWriter(myCoolFile)
        For Each myItem As ListViewItem In ListView1.Items '// loop thru all items in ListView.
            With myItem
                '// write Item & "#" & SubItems... "#" is used for when loading each line and splitting it into arrays.
                myWriter.WriteLine(myItem.Text & "#" & .SubItems(1).Text & "#" & .SubItems(2).Text & "#" _
                                   & .SubItems(3).Text & "#" & .SubItems(4).Text & "#" & .SubItems(5).Text)
            End With
        Next
        myWriter.Close()
    End Sub


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '// customize ListView.
        ListView1.View = View.Details
        With ListView1.Columns
            '// .Add(column name, column width)
            .Add("column 1", 75) : .Add("column 2", 75) : .Add("column 3", 75) : .Add("column 4", 75)
            .Add("column 5", 75) : .Add("column 6", 75)
        End With
        '//------ Load File ------------------------------------------\\
        If IO.File.Exists(myCoolFile) Then '// check if File exists.
            Dim myCoolFileLines() As String = IO.File.ReadAllLines(myCoolFile) '// load your File as a string array.
            For Each line As String In myCoolFileLines '// loop thru array list of File lines.
                Dim lineArray() As String = line.Split("#") '// separate by "#" character.
                Dim newItem As New ListViewItem(lineArray(0)) '// add text Item.
                With newItem.SubItems
                    .Add(lineArray(1)) '// add SubItem 1.
                    .Add(lineArray(2)) '// add SubItem 2.
                    .Add(lineArray(3)) '// add SubItem 3.
                    .Add(lineArray(4)) '// add SubItem 4.
                    .Add(lineArray(5)) '// add SubItem 5.
                End With
                ListView1.Items.Add(newItem) '// add Item to ListView. …
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

For Each lvItem As ListViewItem In ListView1.Items
            If lvItem.Checked = True Then
                Dim newLvItem As New ListViewItem(lvItem.Text)
                '//-- if it contains subitems. --\\
                'newLvItem.SubItems.Add(lvItem.SubItems(1).Text)
                'newLvItem.SubItems.Add(lvItem.SubItems(2).Text)
                ListView2.Items.Add(newLvItem)
                ListView1.Items.Remove(lvItem)
            End If
        Next
codeorder 197 Nearly a Posting Virtuoso
codeorder 197 Nearly a Posting Virtuoso
Select Case buttonPressed.Name
            Case "Button1"
                MsgBox("Button1 clicked.")
            Case "Button2"
                MsgBox("Button2 clicked.")
            Case Else
                MsgBox("Unknown Button clicked.")
        End Select
codeorder 197 Nearly a Posting Virtuoso

See if this helps for calling certain events.

'//-------- Pre-requisites: 1 Button, 1 Timer. ----------\\
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Text = "1"
        Timer1.Start()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.Text += 1
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Button1_Click(sender, e) '// call event.
    End Sub
End Class

And this for calling procedures.

'//-------- Pre-requisites: 1 Timer. ----------\\
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Text = "1"
        Timer1.Start()
    End Sub

    Private Sub someProcedure()
        Me.Text += 1
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Me.someProcedure() '// call procedure.
    End Sub
End Class

Btw, welcome to vb.net forum. :)

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1
    
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        WebBrowser1.Navigate("http://www.google.com/firefox?client=firefox-a&rls=org.mozilla:en-US:official")
    End Sub

    Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        If WebBrowser1.Url.AbsoluteUri = "http://www.google.com/firefox?client=firefox-a&rls=org.mozilla:en-US:official" Then
            MsgBox("Web-page located.", MsgBoxStyle.Information)
        End If
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

codeorder 197 Nearly a Posting Virtuoso

I do not/have not coded any SQL server applications, so I am not certain if a problem could occur from SQL, but...
The operating system you are trying to install your software to might not have the appropriate .NET Framework installed as the .NET Framework you have designed your application to use.

A simple solution to checking which .NET Framework is installed on "the other" computer, is to use Internet Explorer and paste the following in the address bar.

javascript:alert(navigator.userAgent)

Then check for all the .NET #.#.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

'//------ Pre-requisites: 1 Button, 2 ComboBoxes. ----------\\
Public Class Form1
    
    Private myScoreArray() As Integer = {"2", "4", "6", "8", "10"} '// set scores here.

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        '// display result by using .SelectedIndex to select an array from "myScoreArray".
        MsgBox(myScoreArray(ComboBox1.SelectedIndex) + myScoreArray(ComboBox2.SelectedIndex))
    End Sub
End Class

...and IF there is a better way DONT write all the code for me...

Sometimes easier to write code "for me". :D

codeorder 197 Nearly a Posting Virtuoso

Click on a user's name, select the "Friends" tab at the very top and click "Befriend 'username'".

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1
    Private myCoolFile As String = "c:\some old.bat" '// original string.
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        myCoolFile = "c:\something.bat" '// new string.
        MsgBox(myCoolFile) '// display string.
        End
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

Here is something to get started with using a ListView.

'// customize.
        ListView1.View = View.Details '// delete "Details" for other options from IntelliSense.
        ListView1.CheckBoxes = True '// add checkboxes.
        ListView1.FullRowSelect = True '// select entire row when SubItems are listed.
        ListView1.LabelEdit = True '// edit the item's value.
        ListView1.GridLines = True '// show grid lines.
        ListView1.AllowColumnReorder = True '// rearrange columns.
        ListView1.Sorting = SortOrder.Ascending '// alphabetize.
        '// add columns.
        ListView1.Columns.Add("Column 1", 150)
        ListView1.Columns.Add("Column 2", 150)
        ListView1.Columns(0).DisplayIndex = 1 '// rearrange columns.

        ListView1.Font = New Font("Verdana", 12) '// change font.
        ListView1.ForeColor = Color.WhiteSmoke  '// change forecolor.
        ListView1.BackColor = Color.SlateGray  '// change backcolor.

        '// add items.
        ListView1.Items.Add("item 1")
        ListView1.Items(0).SubItems.Add("subitem for 1")
        ListView1.Items.Add("item 2")
        ListView1.Items(1).SubItems.Add("subitem for 2")
        ListView1.Items(1).Font = New Font("Webdings", 16) '// change single item's font.
        ListView1.Items(1).ForeColor = Color.LightSteelBlue   '// change single item's forecolor.
        ListView1.Items(1).BackColor = Color.LightSeaGreen   '// change single item's backcolor.
        ListView1.Items.Add("item 3")
        ListView1.Items(2).SubItems.Add("subitem for 3")
codeorder 197 Nearly a Posting Virtuoso

When working with Files, you should always check if the File exists.

Dim myCoolFile As String = "c:\something.bat" '// your file.

        If IO.File.Exists(myCoolFile) Then '// check if File exists.
            Process.Start(myCoolFile)
        Else '// if File does not exist...
            MsgBox("File Does Not Exist.", MsgBoxStyle.Critical) '// display message.
        End If

As for "cmd.exe", see if this helps.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
        If TextBox1.TextLength = 0 Then '// check if TextBox is empty.
            If Not e.KeyChar = "8" Then '// if not "8".
                e.Handled = True '// cancel the key pressed.
                MsgBox("First character is not 8.", MsgBoxStyle.Critical) '// display message.
            End If
        End If
    End Sub
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1

    Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
        Dim myGraphics As Graphics = e.Graphics
        '// draw Dots.
        Dim myDotPen As New Pen(Color.SteelBlue, 10) '// set DOT pen color and width.
        myGraphics.DrawEllipse(myDotPen, 25, 25, 10, 10) '// (preset pen, location.X, location.Y, width, height)
        myGraphics.DrawEllipse(myDotPen, 75, 25, 10, 10) '// (preset pen, location.X, location.Y, width, height)
        myGraphics.DrawEllipse(myDotPen, 125, 25, 10, 10) '// (preset pen, location.X, location.Y, width, height)
        '// draw Line.
        Dim myLinePen As New Pen(Color.SpringGreen, 5) '// set LINE pen color and width.
        myGraphics.DrawLine(myLinePen, 28, 30, 132, 30) '// (preset pen, startLocation.X, startLocation.Y, endLocation.X, endLocation.Y)
        '// dispose if not needed.
        myGraphics.Dispose() : myDotPen.Dispose() : myLinePen.Dispose()
    End Sub
End Class
AndreRet commented: Nice execution... +4
codeorder 197 Nearly a Posting Virtuoso

Since you are not adding numbers, but "adding to something", use the & character instead.
txtTapeList.Text &= vbNewLine

Final code with setting the cursor to a preset location.

If txtTapeList.Text.EndsWith("L3") Then
            txtTapeList.Text &= vbNewLine
            txtTapeList.Select(txtTapeList.TextLength, 1)'// "txtTapeList.TextLength" = start Index.
        End If
codeorder 197 Nearly a Posting Virtuoso
Dim tempStr As String = "C:\Reading files\bin\Debug\path.txt';"
        MsgBox(tempStr.Substring(0, tempStr.Length - 2)) '// "0" = start Index, "tempStr.Length - 2" = Substring length.
Trle94 commented: tnx :D +0
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

'// code to get Scanned BarCode here.
        If Not TextBox1.Lines.Length = 0 Then '// check if TextBox contains text.
            TextBox1.Text &= vbNewLine & "my Scanned BarCode" '// add new line and BarCode.
        Else
            TextBox1.Text = "my Scanned BarCode" '// add BarCode.
        End If

With the above code, you should not have any "empty" lines in your TextBox.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

'//------- Pre-requisites: 1 Button, 1 TextBox named "phonenumbertxtbox". -------\\
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        With phonenumbertxtbox
            If Not .Text = Nothing Then '// check if not empty.
                If .Text.Length > 0 AndAlso .Text.Substring(0, 1) = "(" Then '// check if length is greater than 0 and if first char. is "(".
                    If .Text.Length > 4 AndAlso .Text.Substring(4, 1) = ")" Then '// check if length is greater than 4 and if 5th char. is ")".
                        If .Text.Length > 8 AndAlso .Text.Substring(8, 1) = "-" Then '// check if length is greater than 8 and if 9th char. is "-".
                            MsgBox("Correct")
                        Else : MsgBox("Incorrect")
                        End If
                    Else : MsgBox("Incorrect")
                    End If
                Else : MsgBox("Incorrect")
                End If
            End If
        End With
    End Sub


    Private Sub phonenumbertxtbox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles phonenumbertxtbox.KeyPress
        Select Case e.KeyChar
            Case "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "(", ")", "-", vbBack '// your pre-selected Characters and Backspace.
                e.Handled = False '// allow.
            Case Else
                e.Handled = True '// block.
        End Select
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        phonenumbertxtbox.MaxLength = 13 '// set max. allowed characters.
    End Sub
End Class
Manny_1 commented: How can I convert this code without a button click +0
codeorder 197 Nearly a Posting Virtuoso

See if this is "simple" enough.

Dim dateBookIssued As Date = "5/24/2005" '// Month, Day, Year.
        Dim dateBookReturned As Date = "10/20/2010" '// Month, Day, Year.
        '// Subtract the Date book was Issued from Date book was Returned.
        Dim overdueTime As TimeSpan = dateBookReturned.Subtract(dateBookIssued)
        '// convert Total Days String to Integer and multiply by .15 cents for each day.
        Dim totalFeeCost As Decimal = CInt(overdueTime.Days.ToString) * 0.15
        '// display formatted Total Fee Cost.
        MsgBox(Format(totalFeeCost, "$#.00"))
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1

    Private myImg(10) As Bitmap '// create Bitmap Array to store images.
    Private myImgAM As New Bitmap("C:\AM.png")
    Private myImgPM As New Bitmap("C:\PM.png")

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '// add Images to Arrays in set order.
        myImg(0) = New Bitmap("C:\0.png")
        myImg(1) = New Bitmap("C:\1.png")
        myImg(2) = New Bitmap("C:\2.png")
        myImg(3) = New Bitmap("C:\3.png")
        myImg(4) = New Bitmap("C:\4.png")
        myImg(5) = New Bitmap("C:\5.png")
        myImg(6) = New Bitmap("C:\6.png")
        myImg(7) = New Bitmap("C:\7.png")
        myImg(8) = New Bitmap("C:\8.png")
        myImg(9) = New Bitmap("C:\9.png")
        '// start timer.
        Timer1.Enabled = True
    End Sub

    Private Sub displayTime()
        Dim x As String = Format(TimeOfDay, "hhmmsstt") '// get Hours, Minutes, Seconds, AM/PM.
        PictureBox1.Image = myImg(CInt(x.Substring(0, 1))) '// (h)hmmsstt.
        PictureBox2.Image = myImg(CInt(x.Substring(1, 1))) '// h(h)mmsstt.
        PictureBox3.Image = myImg(CInt(x.Substring(2, 1))) '// hh(m)msstt.
        PictureBox4.Image = myImg(CInt(x.Substring(3, 1))) '// hhm(m)sstt.
        PictureBox5.Image = myImg(CInt(x.Substring(4, 1))) '// hhmm(s)stt.
        PictureBox6.Image = myImg(CInt(x.Substring(5, 1))) '// hhmms(s)tt.
        If x.Substring(6, 2) = "AM" Then '// hhmmss(tt).
            PictureBox7.Image = myImgAM
        Else
            PictureBox7.Image = myImgPM
        End If
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        displayTime()
    End Sub
End Class
AndreRet commented: Nicely executed. +4
codeorder 197 Nearly a Posting Virtuoso

Edit: Double posted since DaniWeb took too long to Submit/Load webpage.

codeorder 197 Nearly a Posting Virtuoso

See if this helps, if not, do post code.

Dim tempStr As String = RichTextBox1.Rtf '// store Format into String.
        RichTextBox1.Clear() '// clear if needed.
        If RichTextBox1.WordWrap = True Then : RichTextBox1.WordWrap = False : Else : RichTextBox1.WordWrap = True : End If '// toggle WordWrap.
        RichTextBox1.Rtf = tempStr '// set Formated text back.
codeorder 197 Nearly a Posting Virtuoso
Dim myCoolFile As String = "C:\test.txt" '// your file location.
        Dim tempStr As String = IO.File.ReadAllText(myCoolFile) '// read file into a String.
        Dim x As Integer = tempStr.Length - 1 '// get String length, Index based, starting at 0 not 1.
        Dim myArray(x) As String '// create your String Arrays.
        Dim i As Integer = 0 '// Integer used to increase Array #'s.
        For Each myChr As Char In tempStr '// loop thru each each character in the String.
            myArray(i) = myChr '// add values to each String Array.
            i += 1 '// increase count for next Array.
        Next
        MsgBox(myArray(2)) '// display result for 3rd character.
codeorder 197 Nearly a Posting Virtuoso

Not so clear on your reply.
Does your File only contain one line of "TFTTTTTTFFTFTFTTTTFF"?, and are you trying to separate each character into an array?

jual.vimaxterpercaya commented: BONEKA FULL BODY ELECTRIC ini terbuat dari bahan pilihan yang lembut, fleksibel dan berkualitas sehingga tidak menimbulkan penyakit dan iritasi pada kulit. UKURAN : panjang : 165cm berat : 4kg BONEKA FULL BODY ELECTRIC dapat di pompa dan di kemas, d +0
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

'Dim OpenAnswerFile As New OpenFileDialog
        Dim strFileName() As String '// String Array.
        Dim tempStr As String = "" '// temp String for result.

        If OpenAnswerFile.ShowDialog = DialogResult.OK Then '// check if OK was pressed.
            strFileName = IO.File.ReadAllLines(OpenAnswerFile.FileName) '// add each line as String Array.
            For Each myLine In strFileName '// loop thru Arrays.
                tempStr &= myLine & vbNewLine '// add Array and new line.
            Next
            MsgBox(tempStr) '// display result.
        End If
codeorder 197 Nearly a Posting Virtuoso

A bit confusing to understand, but since an Accept Button is like a Submit button on a Form, pressing the Enter key in any of the fields should press the Submit Button, in this case a PictureBox.

If so, see if the following code sample helps.

'//---------  Pre-requisites: 1 PictureBox, 3 TextBoxes. ---------\\
Public Class Form1

    Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
        MsgBox("PictureBox Clicked.", MsgBoxStyle.Information)
    End Sub

    '// use one event for multiple controls.
    Private Sub TextBox1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) _
                                Handles TextBox1.KeyUp, TextBox2.KeyUp, TextBox3.KeyUp
        If e.KeyCode = Keys.Enter Then PictureBox1_Click(sender, e) '// call the event procedure.
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

This part for FileName "C:/account/myfile.txt", use \ instead of /.
Example: "C:\account\myfile.txt"

As for the rest, see if this helps.

Dim n As String = Environment.NewLine
        Dim MyString As String = TextBox1.Text.PadRight(6) '// add first TextBox text.
        '// add to the same string a new line and the following TextBoxes' text.
        MyString &= n & TextBox2.Text.PadRight(3)
        MyString &= n & TextBox3.Text.PadRight(10)
        MyString &= n & TextBox4.Text.PadRight(6)
        MyString &= n & TextBox5.Text.PadRight(8)
        MyString &= n & TextBox6.Text.PadRight(20)
        MyString &= n & TextBox7.Text.PadRight(25)
        MyString &= n & TextBox8.Text.PadRight(3)
        MyString &= n & TextBox9.Text.PadRight(9)
        MyString &= n & TextBox10.Text.PadRight(35)
        My.Computer.FileSystem.WriteAllText("C:\account\myfile.txt", MyString, False) '// write to file.

Btw, my first few hours of programming in vb.net, I was having trouble adding a TextBox to the Form. :D

codeorder 197 Nearly a Posting Virtuoso

Since this question is probably more ASP.NET related than it is VB.NET, the ASP.NET forum might help a little better.

Although, if your website already has the current number of "users(REGISTERED) are LOGGED-IN CURRENTLY " and you just need to retrieve the information, see if this link helps.

codeorder 197 Nearly a Posting Virtuoso

Not much of a book and not much content, but a good start.
www.codeorder.net/pages/tutorials.html

As for teaching you what you need to know, how are we supposed to know "what you need to know"? :D

codeorder 197 Nearly a Posting Virtuoso

:)
Try this modification.

'//--- THIS FILE WILL BE REMOVED FROM MY WEBSITE ONCE THREAD IS SOLVED ---\\
        Dim linkUrl As String = "http://www.codeorder.net/files/tempTestFile.html" '//-- used for testing only.
        '//--- THE FILE CONTENT IN THE LINK ABOVE IS EXACTLY THE CONTENT PREVIOUSLY POSTED BY "killerbeat" ---\\
        Try
            Dim myResponse As Net.HttpWebResponse = Net.HttpWebRequest.Create(linkUrl).GetResponse '// connect.
            Dim myStream As IO.Stream = myResponse.GetResponseStream() '// get.
            Dim myReader As New IO.StreamReader(myStream) '// read.

            Dim myWebFileInfo As String = myReader.ReadToEnd '// get innerHtml of Page.
            
            '// close reader, information stream, and connection.
            myReader.Close() : myStream.Close() : myResponse.Close()

            '// get location of <pre> by index.
            Dim myStartIndex As Integer = myWebFileInfo.IndexOf("<pre>") + 5 '// add +5 to not add "<pre>" to final result.
            '// get location of </pre> by index.
            Dim myEndIndex As Integer = myWebFileInfo.IndexOf("</pre>")
            '// subtract to get a total number for the substring length result.
            Dim myStringLengthToExtract As Integer = myEndIndex - myStartIndex

            '// extract string.
            myWebFileInfo = myWebFileInfo.Substring(myStartIndex, myStringLengthToExtract)
            '// split into string arrays.
            Dim myHtmlTextLines() As String = myWebFileInfo.Split(vbNewLine.ToCharArray)
            '// display result.
            For Each line As String In myHtmlTextLines '// loop thru each line.
                If Not line.StartsWith(" ") Then '// do not add empty lines.
                    If TextBox1.Lines.Length = 0 Then
                        TextBox1.Text &= line & vbNewLine & vbNewLine '// add an empty line after line 1.
                    Else
                        TextBox1.Text &= line & vbNewLine
                    End If
                End If
            Next
            '// remove HTML formatting.
            With TextBox1 : .Text = .Text.Replace("<b>", "") : .Text = .Text.Replace("</b>", "") : End With

        Catch …
codeorder 197 Nearly a Posting Virtuoso

Use "Exit Sub".

Here is a test sample.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim i As Integer = 0
        If i = 0 Then
            i += 1
            MsgBox("i = 1")
        End If
        If i = 1 Then
            i += 1
   '//----------------
            Exit Sub
         '----------------\\
        End If
        If i = 2 Then
            MsgBox("i = 2")
        End If
    End Sub
codeorder 197 Nearly a Posting Virtuoso

How are you adding items to the ListView?

Just add your code to disable the button right after the code of adding the new item. Should work if you start off with ListView.Items.Count = 0.

codeorder 197 Nearly a Posting Virtuoso

You might need this to figure out the C# code posted by sundarchum .

codeorder 197 Nearly a Posting Virtuoso

What Event is your posted code in and are you calling that Event after removing a record?

codeorder 197 Nearly a Posting Virtuoso

Let me know if this helps.

No WebBrowser needed.

'//--- THIS FILE WILL BE REMOVED FROM MY WEBSITE ONCE THREAD IS SOLVED ---\\
        Dim linkUrl As String = "http://www.codeorder.net/files/tempTestFile.html" '//-- used for testing only.
        '//--- THE FILE CONTENT IN THE LINK ABOVE IS EXACTLY THE CONTENT PREVIOUSLY POSTED BY "killerbeat" ---\\
        Try
            Dim myResponse As Net.HttpWebResponse = Net.HttpWebRequest.Create(linkUrl).GetResponse '// connect.
            Dim myStream As IO.Stream = myResponse.GetResponseStream() '// get.
            Dim myReader As New IO.StreamReader(myStream) '// read.

            Dim myWebFileInfo As String = myReader.ReadToEnd '// get innerHtml of Page.

            '// close reader, information stream, and connection.
            myReader.Close() : myStream.Close() : myResponse.Close()

            '// get location of <pre> by index.
            Dim myStartIndex As Integer = myWebFileInfo.IndexOf("<pre>") + 5 '// add +5 to not add "<pre>" to final result.
            '// get location of </pre> by index.
            Dim myEndIndex As Integer = myWebFileInfo.IndexOf("</pre>")
            '// subtract to get a total number for the substring length result.
            Dim myStringLengthToExtract As Integer = myEndIndex - myStartIndex
            '// display result.
            MsgBox(myWebFileInfo.Substring(myStartIndex, myStringLengthToExtract), MsgBoxStyle.Information, "...codeorder...")
        Catch ex As Exception
            MsgBox("Connection Error.", MsgBoxStyle.Critical, "myCool Error Message")
        End Try
codeorder 197 Nearly a Posting Virtuoso

No problem here having a New Project with 2 Forms and using this code.

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.Hide()
        Form2.Show()
    End Sub
End Class

Form1 hides and Form2 shows, nothing else.

codeorder 197 Nearly a Posting Virtuoso

Is it possible to post the Html source code from the web-page?

If too much code to add in this thread, send me a private message with the Html source code and bold out or highlight the area of content you want to retrieve.

codeorder 197 Nearly a Posting Virtuoso

how to check login o x?
thanks

See if this helps.

Public Class Form1
    Private hasLoggedIn As Boolean = False

    Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
        If e.KeyCode = Keys.Enter Then
            If hasLoggedIn = False Then Button1_Click(sender, e)
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If hasLoggedIn = False Then
            hasLoggedIn = True
            MsgBox("Button1_Click")
        End If
    End Sub

End Class
codeorder 197 Nearly a Posting Virtuoso
  • How are you viewing and getting the innerHtml content of the website, from a vb.net WebBrowser?
  • What do you mean by dynamic, the text is not in the original Html file, but added from something like JavaScript once the page is loaded?
codeorder 197 Nearly a Posting Virtuoso
Dim myFile As String = "C:\test.txt" '// file location.
        Dim myWriter As New IO.StreamWriter(myFile)
        For Each myItem As ListViewItem In ListView1.Items
            myWriter.WriteLine(myItem.Text & "|" & myItem.SubItems(1).Text & "|" & myItem.SubItems(2).Text)
        Next
        myWriter.Close()