473,388 Members | 1,340 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 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 1475
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Adrian B. | last post by:
Does anyone know of a framework or library that will enable me to use publish/subscribe comms? I want to create a server (using Python) running on a Unix box that will accept client connections...
6
by: Vijay Kumar R Zanvar | last post by:
Ref: K&R section 8.7 ..... so for a C99 complying implementation, if I've understood correctly, the most restrictive type is long long? Vijay
3
by: Grahammer | last post by:
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...
4
by: Will Ware | last post by:
Python has no inherent provision for a restrictive API that blocks accesses to methods and variables outside an allowed set. Inexperienced Python programmers may fail to adhere to an agreed-upon...
11
by: Stevo | last post by:
I've been using the unload event for a long time. I have this code, which I've abstracted and made into a stripped down simple test case below, and it works fine on the major browsers (IE5+,...
3
by: Mark A | last post by:
At first glance it seems like a good idea to use the new RESTRICTIVE option when creating a database to remove public access otherwise granted by default. Then one could grant the required access...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.