Click here to Skip to main content
15,908,112 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Findcontrol does not work for Usercontrol Pin
Eddy Vluggen24-Jun-16 10:02
professionalEddy Vluggen24-Jun-16 10:02 
GeneralRe: Findcontrol does not work for Usercontrol Pin
Mozartoz24-Jun-16 13:37
Mozartoz24-Jun-16 13:37 
GeneralRe: Findcontrol does not work for Usercontrol Pin
CHill6024-Jun-16 14:05
mveCHill6024-Jun-16 14:05 
GeneralRe: Findcontrol does not work for Usercontrol Pin
Mozartoz24-Jun-16 18:49
Mozartoz24-Jun-16 18:49 
GeneralRe: Findcontrol does not work for Usercontrol Pin
Mozartoz24-Jun-16 21:31
Mozartoz24-Jun-16 21:31 
GeneralRe: Findcontrol does not work for Usercontrol Pin
Pete O'Hanlon27-Jun-16 0:57
mvePete O'Hanlon27-Jun-16 0:57 
QuestionDataGridViewCheckBoxColumn Checking Problem Pin
Member 1209010423-Jun-16 20:10
Member 1209010423-Jun-16 20:10 
AnswerRe: DataGridViewCheckBoxColumn Checking Problem Pin
Richard MacCutchan23-Jun-16 22:25
mveRichard MacCutchan23-Jun-16 22:25 
AnswerRe: DataGridViewCheckBoxColumn Checking Problem Pin
CHill6024-Jun-16 0:23
mveCHill6024-Jun-16 0:23 
GeneralRe: DataGridViewCheckBoxColumn Checking Problem Pin
Member 1209010424-Jun-16 0:55
Member 1209010424-Jun-16 0:55 
GeneralRe: DataGridViewCheckBoxColumn Checking Problem Pin
CHill6024-Jun-16 1:53
mveCHill6024-Jun-16 1:53 
GeneralRe: DataGridViewCheckBoxColumn Checking Problem Pin
Member 1209010425-Jun-16 0:33
Member 1209010425-Jun-16 0:33 
GeneralRe: DataGridViewCheckBoxColumn Checking Problem Pin
CHill6025-Jun-16 14:08
mveCHill6025-Jun-16 14:08 
QuestionIs there any way to eliminate the text based file *****.config Pin
desanti17-Jun-16 5:07
desanti17-Jun-16 5:07 
AnswerRe: Is there any way to eliminate the text based file *****.config Pin
Dave Kreskowiak17-Jun-16 10:19
mveDave Kreskowiak17-Jun-16 10:19 
GeneralRe: Is there any way to eliminate the text based file *****.config Pin
desanti17-Jun-16 11:05
desanti17-Jun-16 11:05 
GeneralRe: Is there any way to eliminate the text based file *****.config Pin
Dave Kreskowiak17-Jun-16 11:16
mveDave Kreskowiak17-Jun-16 11:16 
GeneralRe: Is there any way to eliminate the text based file *****.config Pin
Richard Deeming17-Jun-16 12:42
mveRichard Deeming17-Jun-16 12:42 
Questionproblem to convert stringbuilder to pdf 163 data but show only 162 Pin
mrprakash16-Jun-16 19:56
professionalmrprakash16-Jun-16 19:56 
AnswerRe: problem to convert stringbuilder to pdf 163 data but show only 162 Pin
CHill6016-Jun-16 22:19
mveCHill6016-Jun-16 22:19 
Questioncopy selected row from one gridview to another in VB.net when double click Pin
kishore-201616-Jun-16 15:52
kishore-201616-Jun-16 15:52 
Questionhow can i use one connection to upload multiple files in vb.net Pin
koriewhite16-Jun-16 4:31
koriewhite16-Jun-16 4:31 
i've this application that reads multiple files from a folder and upload them to the server..it works fine but when it wants to upload each file, it creates a connection, upload the file and closes the connection. it does the same thing for all the files over and over again. i want a situation where it creates just one connection, upload all the files and close the connection. please any help will be appreciated, i searched everywhere but couldnt find any help. below is my code

Imports System.IO
Imports System.Net

Public Class DemoFTPServerApp

Dim _Filename As String
Dim _UploadPath As String
Dim f As String


Public Sub LoadFiles(_User As String, _Password As String, _Path As String)
    Dim _MyArraylist As New ArrayList
    Dim FolderPath As String = "C:\Users\Desktop\files"



    Dim finfo As New DirectoryInfo(FolderPath)
    For Each fi In finfo.GetFiles("*.txt")
        _MyArraylist.Add(fi.FullName) 'full path only
        _Filename = fi.FullName
        f = fi.ToString()
        _UploadPath = _Path & f


       Try
      Dim request As FtpWebRequest = DirectCast(WebRequest.Create(New Uri(_UploadPath)), FtpWebRequest)
            request.Method = WebRequestMethods.Ftp.UploadFile
            request.Credentials = New NetworkCredential(_User, _Password)
            request.UseBinary = True
            request.UsePassive = False
            request.KeepAlive = True
            request.ConnectionGroupName = "company name"
            request.ServicePoint.ConnectionLimit = 4
            request.ServicePoint.CloseConnectionGroup("company name")


            Dim buffer(1023) As Byte
            Dim bytesIn As Long = 1

            Dim filepath As System.IO.FileInfo = New System.IO.FileInfo(_Filename)
            Dim _FileStream As System.IO.FileStream = filepath.OpenRead()
            Dim _Stream As System.IO.Stream = request.GetRequestStream


            Do Until bytesIn < 1
                bytesIn = _FileStream.Read(buffer, 0, 1024)
                If bytesIn > 0 Then
                    _Stream.Write(buffer, 0, bytesIn)

                End If
            Loop

            _Stream.Close()
            _Stream.Dispose()
            _FileStream.Close()
            _FileStream.Dispose()
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
    Next

    MessageBox.Show("File Succesfully uploaded!")

End Sub

Private Sub btnUploadFile_Click(sender As Object, e As EventArgs) Handles btnUploadFile.Click

   LoadFiles("username", "password", "ftp://ftpsite.com/")

End Sub

QuestionKeep database in program folder instead of default SQL server folder. Pin
desanti14-Jun-16 7:05
desanti14-Jun-16 7:05 
AnswerRe: Keep database in program folder instead of default SQL server folder. Pin
Eddy Vluggen14-Jun-16 7:14
professionalEddy Vluggen14-Jun-16 7:14 
GeneralRe: Keep database in program folder instead of default SQL server folder. Pin
desanti14-Jun-16 7:56
desanti14-Jun-16 7:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.