Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 149,431 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 2,312 people online right now. Registration is fast and FREE... Join Now!




Network File Send

 
Reply to this topicStart new topic

Network File Send, File Transfer

daffodills
23 Jan, 2008 - 10:34 AM
Post #1

New D.I.C Head
*

Joined: 23 Jan, 2008
Posts: 1

CODE
Dim op As New OpenFileDialog
        Dim ts() As String
        Dim fns As String
        op.Filter = "All Files|*.*"
        If op.ShowDialog Then
            If op.FileName <> "" Then
                ts = Split(op.FileName, "\")
                fns = ts(ts.GetUpperBound(0))

                SRV.SendStringData("FILE@" & fns)
                Dim byt() As Byte
                Dim fs As New FileStream(op.FileName, FileMode.Open)
                Dim sr As New StreamReader(fs)
                ReDim byt(fs.Length)
                fs.Read(byt, 0, fs.Length)
                fs.Close()
                If SRV.SendBinaryData(byt) Then
                    MsgBox("The file has been sent succesfully!", MsgBoxStyle.Information Or MsgBoxStyle.ApplicationModal, "File Sent!")
                End If
            End If
        End If

User is offlineProfile CardPM
+Quote Post

Jayman
RE: Network File Send
23 Jan, 2008 - 11:52 AM
Post #2

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 7,298



Thanked: 66 times
Dream Kudos: 500
Expert In: Everything

My Contributions
Do you have a question related to the code you posted?
User is online!Profile CardPM
+Quote Post

Binu Mathew
RE: Network File Send
20 Apr, 2008 - 12:26 AM
Post #3

New D.I.C Head
*

Joined: 20 Apr, 2008
Posts: 1

what is srv?

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 11:53AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month