Help C# to .NET !

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
10 posts Page 1 of 1
Contributors
User avatar
M1z23R
VIP - Donator
VIP - Donator
Posts: 622
Joined: Tue Sep 28, 2010 4:55 pm

Help C# to .NET !
M1z23R
Don't know where should i put this but any way, i am trying to convert chat application C# code into VB.NET !
I can't get this ... :(
Code: Select all
 Dim srReceiver As StreamReader
 srReceiver = new StreamReader(tcpServer.GetStream());
If anyone knows where to put this or if knows how to convert ?
Online code didn't make it usable :/
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

Re: Help C# to .NET !
Axel
srReceiver = new StreamReader(tcpServer.GetStream()); To vb =

Dim srReceiver as SteamReader = new StreamReader(args) , with other words , args should be "tcpServer.GetStream()"
http://vagex.com/?ref=25000
User avatar
M1z23R
VIP - Donator
VIP - Donator
Posts: 622
Joined: Tue Sep 28, 2010 4:55 pm

Re: Help C# to .NET !
M1z23R
Image
User avatar
Agust1337
Coding God
Coding God
Posts: 2456
Joined: Fri Feb 19, 2010 8:18 pm

Re: Help C# to .NET !
Agust1337
on the picture is that c# or vb?
Top-notch casual Dating
User avatar
Codex
Coding God
Coding God
Posts: 2028
Joined: Wed Mar 31, 2010 5:50 pm

Re: Help C# to .NET !
Codex
Code: Select all
srReceiver = new StreamReader(tcpServer.GetStream());
=
Code: Select all
Dim srReceiver as StreamReader = tcpServer.Getstream() 
Tell me if it works...
Last edited by Codex on Sat Jan 15, 2011 5:46 pm, edited 1 time in total.
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
User avatar
MrAksel
C# Coder
C# Coder
Posts: 1758
Joined: Fri Mar 26, 2010 12:27 pm

Re: Help C# to .NET !
MrAksel
Codex, if that should work, you have to remove the 'New' specifier
And what is the type of 'tcpServer' is it a tcpClient or tcpListener? If it is a client you can use this:
Code: Select all
Dim s As Net.Sockets.NetworkStream = tcpServer.GetStream
         Dim baseByte() As Byte
         s.Read(baseByte, 0, s.Length)
         Dim m As IO.Stream = New IO.MemoryStream(baseByte)
         Dim srReceiver As New IO.StreamReader(m)
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;


Over 30 projects with source code!
Please give reputation to helpful members!

Image
Image
User avatar
M1z23R
VIP - Donator
VIP - Donator
Posts: 622
Joined: Tue Sep 28, 2010 4:55 pm

Re: Help C# to .NET !
M1z23R
Dim tcpServer = New TcpClient()
User avatar
Codex
Coding God
Coding God
Posts: 2028
Joined: Wed Mar 31, 2010 5:50 pm

Re: Help C# to .NET !
Codex
M1z23R wrote:
Dim tcpServer = New TcpClient()
If that solved it then lock your topic, if possible.
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
User avatar
M1z23R
VIP - Donator
VIP - Donator
Posts: 622
Joined: Tue Sep 28, 2010 4:55 pm

Re: Help C# to .NET !
M1z23R
MrAksel wrote:
Codex, if that should work, you have to remove the 'New' specifier
And what is the type of 'tcpServer' is it a tcpClient or tcpListener? If it is a client you can use this:
Code: Select all
Dim s As Net.Sockets.NetworkStream = tcpServer.GetStream
         Dim baseByte() As Byte
         s.Read(baseByte, 0, s.Length)
         Dim m As IO.Stream = New IO.MemoryStream(baseByte)
         Dim srReceiver As New IO.StreamReader(m)
"This stream does not support seek operations."

:( Still nothing :/

Still didn't solve it :(
User avatar
M1z23R
VIP - Donator
VIP - Donator
Posts: 622
Joined: Tue Sep 28, 2010 4:55 pm

Re: Help C# to .NET !
M1z23R
THANKS A LOT ! I got it :)

I used half of your code Codex
Code: Select all
Dim s As Net.Sockets.NetworkStream = tcpServer.GetStream
  
        srReceiver = New StreamReader(s)
It worked perfectly ! :)

Tnx
10 posts Page 1 of 1
Return to “Tutorial Requests”