Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 20th, 2012, 04:43 PM
darkhacks darkhacks is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2012
Posts: 2 darkhacks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 4 m 48 sec
Reputation Power: 0
Problem with ListBox

Hi i have some problem with my ListBox, after I've browsed a txt file by means of OpenFileDialog to ListBox, all words except the 1-st one are preceded by "square". I don't know how to fix it. Maybe you have any ideas....

(When I open it in RichTextBox it's all fine no square or something)

This is my code:
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 
OpenFileDialog1.ShowDialog() 
streamer = IO.File.OpenText(OpenFileDialog1.FileName)
Dim mystring() As String = streamer.ReadToEnd.Split(vbNewLine)
 ListBox1.Items.AddRange(mystring) 
End Sub


My text file and Screen:
Code:
http://speedy.sh/UXgrd/file.rar


This code have been testing on another computer and worked, so I didn't have any ideas to resolve my problem.

Reply With Quote
  #2  
Old July 20th, 2012, 08:22 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Jun 2003
Posts: 14,239 Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Weeks 15 h 20 m 7 sec
Reputation Power: 4445
Usually a strange character indicates some kind of encoding mismatch, like a utf8 character in an ascii control.

It's hard to look at your code when it's all on one line.
__________________
======
Doug G
======
It is a truism of American politics that no man who can win an election deserves to. --Trevanian, from the novel Shibumi

Reply With Quote
  #3  
Old July 21st, 2012, 04:44 AM
darkhacks darkhacks is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2012
Posts: 2 darkhacks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 4 m 48 sec
Reputation Power: 0
Ok sorry, now it's better.

I have a solution (i've changed my code a little bit)

Now now looks like this:

Code:
OpenFileDialog1.ShowDialog() 
streamer = IO.File.OpenText(OpenFileDialog1.FileName) 
Dim delimiters() As Char = New Char() {vbCr, vbLf} 
Dim mystring() As String = streamer.ReadToEnd.Split(delimiters, StringSplitOptions.RemoveEmptyEntries) 
ListBox1.Items.AddRange(mystring)




I have this:

Code:
ListBox1.SelectedIndex = 0 
Dim login As String = ListBox1.SelectedItem.ToString.Split(":")(0) 
Dim hasło As String = ListBox1.SelectedItem.ToString.Split(":")(1) 
WebBrowser1.Document.GetElementById("log").SetAttribute("value", login) 
WebBrowser1.Document.GetElementById("pwd").SetAttribute("value", hasło) 
WebBrowser1.Document.GetElementById("wp-submit").InvokeMember("click")

Now nicely put in field of the login and password information that is in the first listbox (They are separated by ":" ex login:password)
Only now I do not know how to do loops to repeat this action , until it logged in or address will change. :/

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Problem with ListBox

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap