Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Moving a file over a network.

Moving a file over a network.

Scheduled Pinned Locked Moved C#
sysadminquestion
9 Posts 3 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dylan van Heerden
    wrote on last edited by
    #1

    I'm trying to move a file over the network with "file.Move(Filename, Destination);". I'm recieving the following "Access to path \\192.168.109.112\InSMS is denied". The folder is shared and it's possible for other network users to change the files. Am I missing something? My brain is 2 small for all the knowledge that I need.

    C 1 Reply Last reply
    0
    • D Dylan van Heerden

      I'm trying to move a file over the network with "file.Move(Filename, Destination);". I'm recieving the following "Access to path \\192.168.109.112\InSMS is denied". The folder is shared and it's possible for other network users to change the files. Am I missing something? My brain is 2 small for all the knowledge that I need.

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Could your application be running in a different account? _Hacker wrote: My brain is 2 small for all the knowledge that I need. I doubt that. One estimate I read of the human brain capacity put it at 25,000 terrabytes for actual usage. Considering that humans use only an estimated 10% of capacity I am sure you have more than sufficient to spare. However, if Moore's Law keeps up there will be available single mass storage devices that could hold a similar capacity in about 23 years.


      Do you want to know more?


      Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.

      D H 2 Replies Last reply
      0
      • C Colin Angus Mackay

        Could your application be running in a different account? _Hacker wrote: My brain is 2 small for all the knowledge that I need. I doubt that. One estimate I read of the human brain capacity put it at 25,000 terrabytes for actual usage. Considering that humans use only an estimated 10% of capacity I am sure you have more than sufficient to spare. However, if Moore's Law keeps up there will be available single mass storage devices that could hold a similar capacity in about 23 years.


        Do you want to know more?


        Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.

        D Offline
        D Offline
        Dylan van Heerden
        wrote on last edited by
        #3

        Yes I think it's possible that my application is running on a different account. The application is actually a c# class library that's being called from a webservice. The library writes out a file and after that's done, I just need it to copy the file to the destination where I need it to be... This "My brain is 2 small for all the knowledge that I need" is only a signature you don't need to worry about it. My brain is 2 small for all the knowledge that I need.

        C 1 Reply Last reply
        0
        • D Dylan van Heerden

          Yes I think it's possible that my application is running on a different account. The application is actually a c# class library that's being called from a webservice. The library writes out a file and after that's done, I just need it to copy the file to the destination where I need it to be... This "My brain is 2 small for all the knowledge that I need" is only a signature you don't need to worry about it. My brain is 2 small for all the knowledge that I need.

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          You need to set the security permissions so that your webservice can write to the directory you want the file moved to then. So on the directory you need to add the permissions for the account the web service is running as. _Hacker wrote: is only a signature you don't need to worry about it. I realised that. It just seemed like a kind of defeatist attitude to me.


          Do you want to know more?


          Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.

          D 1 Reply Last reply
          0
          • C Colin Angus Mackay

            You need to set the security permissions so that your webservice can write to the directory you want the file moved to then. So on the directory you need to add the permissions for the account the web service is running as. _Hacker wrote: is only a signature you don't need to worry about it. I realised that. It just seemed like a kind of defeatist attitude to me.


            Do you want to know more?


            Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.

            D Offline
            D Offline
            Dylan van Heerden
            wrote on last edited by
            #5

            Where do I set the permissions for the webservice? Colin Angus Mackay wrote: It just seemed like a kind of defeatist attitude to me. Sorry for the inconvenience. My brain is 2 small for all the knowledge that I need.

            C 1 Reply Last reply
            0
            • D Dylan van Heerden

              Where do I set the permissions for the webservice? Colin Angus Mackay wrote: It just seemed like a kind of defeatist attitude to me. Sorry for the inconvenience. My brain is 2 small for all the knowledge that I need.

              C Offline
              C Offline
              Colin Angus Mackay
              wrote on last edited by
              #6

              _Hacker wrote: Where do I set the permissions for the webservice? On the folder, right-click, select properties, go to the security tab and add the account that the web serice runs in and give it the relevant permissions (I think it would be "modify" which automatically selects some other dependent permissions as well). Once this is applied it should work.


              Do you want to know more?


              Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.

              D 1 Reply Last reply
              0
              • C Colin Angus Mackay

                _Hacker wrote: Where do I set the permissions for the webservice? On the folder, right-click, select properties, go to the security tab and add the account that the web serice runs in and give it the relevant permissions (I think it would be "modify" which automatically selects some other dependent permissions as well). Once this is applied it should work.


                Do you want to know more?


                Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.

                D Offline
                D Offline
                Dylan van Heerden
                wrote on last edited by
                #7

                Thx My brain is 2 small for all the knowledge that I need.

                H 1 Reply Last reply
                0
                • C Colin Angus Mackay

                  Could your application be running in a different account? _Hacker wrote: My brain is 2 small for all the knowledge that I need. I doubt that. One estimate I read of the human brain capacity put it at 25,000 terrabytes for actual usage. Considering that humans use only an estimated 10% of capacity I am sure you have more than sufficient to spare. However, if Moore's Law keeps up there will be available single mass storage devices that could hold a similar capacity in about 23 years.


                  Do you want to know more?


                  Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.

                  H Offline
                  H Offline
                  Heath Stewart
                  wrote on last edited by
                  #8

                  I need a second "drive" then - or just a damn good defragmenter. Retaining most of what I read, see, and hear (which can suck) I'm starting to get way too much thrashing. My driver might be a little bad, too, since the heavy fragmentation is leading to data corruption (mixing of fragments into incomprehensible rubbish). :) This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles] [My Blog]

                  1 Reply Last reply
                  0
                  • D Dylan van Heerden

                    Thx My brain is 2 small for all the knowledge that I need.

                    H Offline
                    H Offline
                    Heath Stewart
                    wrote on last edited by
                    #9

                    By default ASP.NET runs under the ASPNET account, a local machine account. This can cause a problem, especially since the password is, by default, randomly generated when the AppDomain is recycled. If you're on a domain (and presumably you are), I (and most other developers familiar with this problem) recommend changing your machine.config file to use a domain account (like MYDOMAIN\ASPNET) and the password assigned to that user. This file is protected under strict ACLs so you shouldn't worry too much. That'll make it easier for the web service running under ASP.NET to copy files, since you're now using a domain account instead of a local account (which you might not even be able to reference depending on your network topology). See the <httpRuntime> element documentation in the .NET Framework SDK for more information. Alternatively, you could enable impersonation. That's a little more drawn-out, so I would refer you to the .NET Framework SDK and MSDN[^] articles about how to do that, or ask in the ASP.NET forum here. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles] [My Blog]

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups