Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1165
  • Last Modified:

transfer data via modem with mscomm32

HI
I have problem with transfer data via modem in VB .I can send & receive textfile but i can't send & receive pics or exe file. I use from mscomm and my input mode propert set to text
and i read & write  binary from a file .but i have a problem with send & receive pics & exe file.
my receive file can' t run and my picture is damage.
pleas help me
thanks
0
anooshe
Asked:
anooshe
  • 2
  • 2
1 Solution
 
jcaceresCommented:
You could use microsoft winsock control to achieve this. There is one good code sample in this url http://www.a1vbcode.com/coderedirect.asp?type=application&ID=341

should work for u.

cheers.
0
 
1makCommented:
You need to send/receive binary data to transfer pics and exe files.

Set your InputMode to comInputModeBinary. And then pass Byte arrays to the Output method, and also use a Byte array when calling Input in your receiver application.

0
 
anoosheAuthor Commented:
Hi 1mak
I write codef for every operation ,when i send text in textbox i send "#@" & text and another PC recognize i send a text and show it in texttbox.and when i send "#@" & filenname &filesize &file another PC recognize that send a file. my Input mode set to text and i can recognize this code and file name and size but when I set it to Binary I can't recognize my code and filename an my receive procedure will be fail. if you have possible for you send me a source code for this. or guide me in my project.
thanks
0
 
1makCommented:
So....

You're saying that you want to send the name of the file & the size of the file as a header prior to actually sending the file itself?
How about you send that in text mode, and then, once you get a response from the client that it's received the header, switch both server and client to binary, and then push the file itself?


0
 
anoosheAuthor Commented:
hi
thanks for replay .
but when I set my property to text in Client & Server I can't  sned and receive data because my Header that is "#@" & filename ,... don't recognize in binary mode.
Good Luck
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now