473,379 Members | 1,220 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,379 software developers and data experts.

Socket programming in vb.net

can socket programming in vb.net use for data transfer such as login data? all the samples that i found on internet is just a chat program. can someone show me some sample code on simple login for user name and password to be transfered from client to server? thanks in advance.
May 3 '07 #1
5 7450
can socket programming in vb.net use for data transfer such as login data? all the samples that i found on internet is just a chat program. can someone show me some sample code on simple login for user name and password to be transfered from client to server? thanks in advance.

I'm not sure at client side, but in c# I connect to a server end database through a telnet connection, and I have a text box that submits my text commands to the server, and It accepts my user and password that way. Although it prompts me for user first, I submit that, then it prompts for password, and I submit that next. I was thinking of having it submit it in a different form, and I thought the easiest way to do it would be to input the username and password, then when you click submit, it would submit the data stored in two seperate variables in sequential order. I'm not sure if that would work for your application though.
May 7 '07 #2
ummmmmmm look you can send it using socket programming, but you have to build messaging policy between the client and the server (as protocols do, you put a header for your message to tell the server what is the content of this message and according to this header you do some task) for example you build a string like "USRNAME=BLABLABLA" and send it to the server ,"PASSWORD=BLABLABLABLA" and send it to the server.
and as sockets send array of bytes use Encoding.ASCII.GetBytes(yourstring); this will retrive the array of bytes for you send this array of bytes from the client.

Note: you can build only one message "username=blablabla~~password=blabla"

At the Server make a byte[] of suffient size for example [1024] = 1 KB. and receive this the incoming bytes in this array by using Encoding.ASCII.GetString(byte[]); retrive the string that was sent from the client.
At the server you have to perform some processing on this string to extract the information included in it, string.split(.....), string.substring(.....) all of this is traditional programming and easily i think you can perform it.

if you want to secure your message you can use encryption to encrypt all of your string.
and on the other end decrypt it using different encryption algorithms provided by .Netframework at System.Net.Security namespace

does this help?
May 8 '07 #3
I was able to send user name and password to the server side for processing now with the split function. but i was thinking to send some bigger size of data such as dataset or reports.... any idea on doing this? thanks again for above 2 answers.
May 8 '07 #4
sekarm
26
Thanks Guyz,
I have also searching the idea for the aboce thinks. can u show the code or link for above requirements.its very useful for me.

Thanks In Advance,
Sekar.M
May 8 '07 #5
umm i'm not sure about it but you can use object serlialization and deserlization to send some data from one node to another.
Search at Microsoft MSDN about serlization basic you will get an easy way to serlize objects and get byte[] to be sent over the network
May 8 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: pyguy2 | last post by:
Issues of socket programming can be wierd, so I'm looking for some comments. In my python books I find exclusive use of socket.close(). From my other readings, I know about a "partial close...
5
by: John Sheppard | last post by:
Hi all, I am not sure that I am posting this in the right group but here it goes anyway. I am new to socket programming and I have been searching on the internet to the questions I am about to pose...
1
by: John Sheppard | last post by:
Thanks to everyone that responded to my previous Socket Programming question. Now I have run into some behavior that I don't quite understand. Programming environment. VS.NET 2003, C#, Windows...
5
by: mscirri | last post by:
The code below is what I am using to asynchronously get data from a PocketPC device. The data comes in fine in blocks of 1024 bytes but even when I send no data from the PocketPC constant blocks of...
2
by: djc | last post by:
I read a network programming book (based on framework 1.1) which indicated that you should 'never' use the RecieveTimeout or the SendTimeout 'socket options' on TCP sockets or you may loose data. I...
10
by: Uma - Chellasoft | last post by:
Hai, I am new to VB.Net programming, directly doing socket programming. In C, I will be able to map the message arrived in a socket directly to a structure. Is this possible in VB.Net. Can...
11
by: atlaste | last post by:
Hi, In an attempt to create a full-blown webcrawler I've found myself writing a wrapper around the Socket class in an attempt to make it completely async, supporting timeouts and some scheduling...
0
by: shonen | last post by:
I'm currently attempting to connect to a shoutcast server pull down the information from here and then I'll parse it. I got this working with the httplib, which was great, the problem is I want...
8
by: =?Utf-8?B?Sm9obg==?= | last post by:
Hi all, I am new to .net technologies. ASP.NET supports socket programming like send/receive in c or c++? I am developing web-site application in asp.net and code behind is Visual C#. In...
3
by: Stuart | last post by:
I am in the process of teaching myself socket programming. I am "playing around" with some simple echo server-client programs for m the book TCP/IP Sockets in C. The Server program is: ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.