Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5986411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:40:03+00:00 2026-05-22T22:40:03+00:00

I am working on vb.net win form. My task is display the file names

  • 0

I am working on vb.net win form. My task is display the file names from a folder onto gridview control. when user clicks process button in my UI, all the file names present in gridview, the corresponding file has to be loaded onto memory stream buffer one after another and append the titles to the content of the file and save it in hard drive with _ed as a suffix to the file name.

I am very basic programmer. I have done the following attempt and succeeded in displaying filenames onto gridview. But no idea of later part. Any suggestions please?

‘Displaying files from a folder onto a gridview

    Dim inqueuePath As String = "C:\Users\Desktop\INQUEUE"
    Dim fileInfo() As String
    Dim rowint As Integer = 0
    Dim name As String
    Dim directoryInfo As New System.IO.DirectoryInfo(inqueuePath)
    fileInfo = System.IO.Directory.GetFiles(inqueuePath)

    With Gridview1
        .Columns.Add("Column 0", "FileName")
        .AutoResizeColumns()
    End With

    For Each name In fileInfo
        Gridview1.Rows.Add()
        Dim filename As String = System.IO.Path.GetFileName(name)
        Gridview1.Item(0, rowint).Value = filename
        rowint = rowint + 1
    Next

Thank you very much for spending your valuable time to read this post.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T22:40:04+00:00Added an answer on May 22, 2026 at 10:40 pm

    to read a file into a memorystream is quite easy, just have a look at the following example and you should be able to convert it to suite your needs:

        Dim bData As Byte()
        Dim br As BinaryReader = New BinaryReader(System.IO.File.OpenRead(Path))
        bData = br.ReadBytes(br.BaseStream.Length)
        Dim ms As MemoryStream = New MemoryStream(bData, 0, bData.Length)
        ms.Write(bData, 0, bData.Length)
    

    then just use the MemoryStream ms as you please. Just to clearify Path holds the full path and filename you want to read into your memorystream.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As I am working on .Net windows form application, we're using MongoDB for back-end
I am working on a VB.net (VS-2010, Win XP Pro 2 SP3), Employee Management
I am working in an asp.net aplication which being developed on win 32 bit
I've just been given the task of getting a previously working version of an
I have a Winform project built in .NET 4. It contains two forms and
I'm trying to do a splash screen using CF.NET but I'm lost in the
I had a working WCF published to IIS on my server. Recently I created
I'm just starting out with ASP.NET, all my prior experience has been with desktop
This question is related to Winform application deployment and configuration. I am new to
I'm using AjaxPro & AjaxControlToolkit in my project. My project is normally running on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.