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

  • SEARCH
  • Home
  • 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 758889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:31:57+00:00 2026-05-14T15:31:57+00:00

I created a desktop application using VS 2008. When I run it locally, all

  • 0

I created a desktop application using VS 2008.

When I run it locally, all works well.

I shared my output folder (WITHOUT allowing network users to change my files)
and ran my exe from another Vista computer on our intranet.

When running the shared exe, I receive “System.UnauthorizedAccessException” when trying to read a file.

How can I give permission to allow reading the file?
Should I change the code?
Should I grant permission to the application\folder on the Vista computer? how?

Notes:

  • I do not use ClickOnce. the application should be distributed using xcopy.

  • My application target framework is “.Net Framework 2.0”

  • On the Vista computer, “controlPanel | UninstallOrChangePrograms” it says it has “Microsoft .Net Framework 3.5 SP1”

  • I also tried to map the folder drive, but got the same errors, only now the fileName is “T:\my.ocx”

    ‘ ———————————————————————-

    ‘ my code:

    Dim src As String = mcGlobals.cmcFiles.mcGetFileNameOcx()
    Dim ioStream As New System.IO.FileStream(src, IO.FileMode.Open)

    ‘ ———————————————————————-

    Public Shared Function mcGetFileNameOcx() As String

    ‘ ———————————————————————-

      Dim dirName As String = Application.StartupPath & "\"
      Dim sFiles() As String = System.IO.Directory.GetFiles(dirName, "*.ocx")
    
      Dim i As Integer
      For i = 0 To UBound(sFiles)
        Debug.WriteLine(System.IO.Path.GetFullPath(sFiles(i)))
        ' if found any - return the first:
        Return System.IO.Path.GetFullPath(sFiles(i))
      Next
      Return "" 
    
    End Function
    

    ‘ ———————————————————————-

    ‘ The Exception I receive:

    System.UnauthorizedAccessException: Access to the path '\\computerName\sharedFolderName\my.ocx' is denied.
      at System.IO._Error(Int32 errorCode, String maybeFullPath)
      at System.IO.FileStream.Init(...)
      at System.IO.FileStream..ctor(...)
      at System.IO.FileStream..ctor(String path, FileMode mode)
    

    ‘ ———————————————————————-

  • 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-14T15:31:57+00:00Added an answer on May 14, 2026 at 3:31 pm

    found it.

    According to MSDN, [FileStream Constructor (String, FileMode) ]

    . . . For constructors without a FileAccess parameter,

    • if the mode parameter is set to Append, Write is the default access.
    • Otherwise, the access is set to ReadWrite.

    -> my code used the default, with ioStream.CanWrite:=True, and I do not have Write permission on the shared folder.

    so I added FileAccess parameter:

    new code:
    Dim ioStream As New System.IO.FileStream(srcOcx, IO.FileMode.Open, IO.FileAccess.Read) 
    
    old code:
    Dim ioStream As New System.IO.FileStream(srcOcx, IO.FileMode.Open) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 523k
  • Answers 523k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer What we use is the following first build the website… May 16, 2026 at 9:30 pm
  • Editorial Team
    Editorial Team added an answer I assume "Convert" means making build for another version. In… May 16, 2026 at 9:30 pm
  • Editorial Team
    Editorial Team added an answer If you don't mind using a CTE, following script produces… May 16, 2026 at 9:30 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm using Visual Studio 2008 and have created a setup project for my application.
I'm writing a desktop application in Visual Studio 2008 / C# I finished (mostly)
I have a simple winforms application in VB.NET 2008. I am using a form
I want to produce a desktop application with a very simple GUI (a background
I have created a simple scenario using Log4net, but it seems that my log
I have a Java web application that has a 'disconnected' Java Swing desktop app.
I am using ASP.NET Dynamic Data Entities project to generate a web application for
I have a .NET Windows service and a .NET Web Application that I would
VS 2010 comes with SQL 2008 Express, and upgrades existing project's databases to SQL
I need to develop an application with following features and want to understand if

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.