471,055 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,055 software developers and data experts.

VB.Net more restrictive?

Is it just me, or is VB.Net much more restrictive than VB6?

For example... I'm trying to build a control that will check a POP3 email
account for mail and allow the user to enter POP commands while connected.
Later I'll do the same for SMTP and for a Telnet session... I cannot find
any evidence of any event driven method to read data from the incoming
buffer. Instead, I need to set a timer and repeatedly check to see if there
is any data in the buffer. Am I wrong in this?

Another example. Try printing a RichTextbox control in VB6. It's quite
simple. Try doing the same in VB.Net... Next to impossible and requires
pages of code.

Another example. Try creating a user control with a transparent background.
It can't be done in VB.Net, while is was simply a matter of setting a
transparent color in VB6.

Why are these things so difficult to do?
Jul 21 '05 #1
3 1402
See below regarding your SMTP-client....

Dim client As New System.Net.Sockets.TcpClient()
Dim InBuff() As Byte
While True
While Not client.GetStream.DataAvailable()
Application.DoEvents()
End While
If client.GetStream.DataAvailable() Then
client.GetStream().Read(InBuff, 0, InBuff.Length)
temp = System.Text.Encoding.Default.GetString(InBuff, 0,
InBuff.Length)
InBuff.Clear(InBuff, 0, InBuff.Length)
Return temp
End If
End While

/Fehre

"Grahammer" <po********@127.0.0.1> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
Is it just me, or is VB.Net much more restrictive than VB6?

For example... I'm trying to build a control that will check a POP3 email
account for mail and allow the user to enter POP commands while connected.
Later I'll do the same for SMTP and for a Telnet session... I cannot find
any evidence of any event driven method to read data from the incoming
buffer. Instead, I need to set a timer and repeatedly check to see if there is any data in the buffer. Am I wrong in this?

Another example. Try printing a RichTextbox control in VB6. It's quite
simple. Try doing the same in VB.Net... Next to impossible and requires
pages of code.

Another example. Try creating a user control with a transparent background. It can't be done in VB.Net, while is was simply a matter of setting a
transparent color in VB6.

Why are these things so difficult to do?

Jul 21 '05 #2
Fredrik Fehre <ne*************@dx.se> wrote:
See below regarding your SMTP-client....

Dim client As New System.Net.Sockets.TcpClient()
Dim InBuff() As Byte
While True
While Not client.GetStream.DataAvailable()
Application.DoEvents()
End While
If client.GetStream.DataAvailable() Then
client.GetStream().Read(InBuff, 0, InBuff.Length)
temp = System.Text.Encoding.Default.GetString(InBuff, 0,
InBuff.Length)
InBuff.Clear(InBuff, 0, InBuff.Length)
Return temp
End If
End While


That will end up with corrupt data - you're assuming that every time
there is *some* data available, there's enough for the whole buffer.
You should *always* use the return value of Stream.Read.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #3

"Fredrik Fehre" <ne*************@dx.se> wrote in message
news:kE********************@newsb.telia.net...
See below regarding your SMTP-client....

Dim client As New System.Net.Sockets.TcpClient()
Dim InBuff() As Byte
While True
While Not client.GetStream.DataAvailable()
Application.DoEvents()
End While
If client.GetStream.DataAvailable() Then
client.GetStream().Read(InBuff, 0, InBuff.Length)
temp = System.Text.Encoding.Default.GetString(InBuff, 0,
InBuff.Length)
InBuff.Clear(InBuff, 0, InBuff.Length)
Return temp
End If
End While

/Fehre

"Grahammer" <po********@127.0.0.1> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
Is it just me, or is VB.Net much more restrictive than VB6?

For example... I'm trying to build a control that will check a POP3 email account for mail and allow the user to enter POP commands while connected. Later I'll do the same for SMTP and for a Telnet session... I cannot find any evidence of any event driven method to read data from the incoming
buffer. Instead, I need to set a timer and repeatedly check to see if

there
is any data in the buffer. Am I wrong in this?

Another example. Try printing a RichTextbox control in VB6. It's quite
simple. Try doing the same in VB.Net... Next to impossible and requires
pages of code.

Another example. Try creating a user control with a transparent

background.
It can't be done in VB.Net, while is was simply a matter of setting a
transparent color in VB6.

Why are these things so difficult to do?


Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

18 posts views Thread by Adrian B. | last post: by
6 posts views Thread by Vijay Kumar R Zanvar | last post: by
3 posts views Thread by Grahammer | last post: by
4 posts views Thread by Will Ware | last post: by
3 posts views Thread by Mark A | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.