Jump to content

[VB.Net] While e Text


Ivo Pereira

Recommended Posts

bom pessoal, fiz uma experienciazinha com o while que tou a aprender a mexer com ele... mas nao me saiu muito bem...

        Dim swreader1 As New StreamReader("C:\alunos.txt")

        Do While swreader1.EndOfStream = -1
            cmbAlunoEliminado.Items.AddRange(Split(swreader1.ReadToEnd, _
vbCrLf))
            cmbAlunos.Items.AddRange(Split(swreader1.ReadToEnd, _
vbCrLf))
            swreader1.Close()

        Loop

o que tá mal aqui? :nono1:

era suposto por o menos o combobox AlunoEliminado ficar preenchida com os valores da textfile... sim eu já sei que o outro nao iria ficar porque na primeira combo aquilo lê o ficheiro até ao fim, já agora, se me souberem dizer como é que faço para ele vir para o inicio do texto para ler de novo para a segunda combobox agradecia...

Cumps

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.