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
  1. Home
  2. General Programming
  3. C#
  4. give sample code plzz?

give sample code plzz?

Scheduled Pinned Locked Moved C#
helpcomsysadminjsonperformance
7 Posts 2 Posters 0 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.
  • I Offline
    I Offline
    imran_rafique
    wrote on last edited by
    #1

    i want to start a local process that should be started by loading the executable located on the remote computer into local memory. i am sharing the folder on the remote machine.but it could not be started. in order to start that one i am using process class and its method Process.Start. but it throws an exception of type Win32Exception(There was an error in opening the associated file that is at shared network path). i dont know how to resolve that can any body help. one person(thanks for him) tells that i have to call api like NetUseAdd etc but i could not understand how to use that can any body write a sample code for me plzzzzzzzzzzz? if i map a network drive for that executable located on the remote computer. Process.Start still not working for that drive too. r00d0034@yahoo.com

    G 1 Reply Last reply
    0
    • I imran_rafique

      i want to start a local process that should be started by loading the executable located on the remote computer into local memory. i am sharing the folder on the remote machine.but it could not be started. in order to start that one i am using process class and its method Process.Start. but it throws an exception of type Win32Exception(There was an error in opening the associated file that is at shared network path). i dont know how to resolve that can any body help. one person(thanks for him) tells that i have to call api like NetUseAdd etc but i could not understand how to use that can any body write a sample code for me plzzzzzzzzzzz? if i map a network drive for that executable located on the remote computer. Process.Start still not working for that drive too. r00d0034@yahoo.com

      G Offline
      G Offline
      Gaul
      wrote on last edited by
      #2

      You need to check your security/permissions for the network drive. Dot Net has code access security that checks to see if the code is running from or is loaded from an authorized location. The default security policy setting does not allow you to load and execute code from a network drive. To see if that is your problem, go to Administrative Tools | .NET Framework Configuration | Configure Code Access Security Policy (same as Runtime Security Policy. Then select Adjust Zone Security, the checkbox 'Make changes to this computer', and then Local Intranet. You can change it to 'Full Trust' and then run your code again. Be careful, and make sure you know what you are doing. You can reset it back to what it was after you have been able to test your code to see if that is your problem. Gaulles

      I 2 Replies Last reply
      0
      • G Gaul

        You need to check your security/permissions for the network drive. Dot Net has code access security that checks to see if the code is running from or is loaded from an authorized location. The default security policy setting does not allow you to load and execute code from a network drive. To see if that is your problem, go to Administrative Tools | .NET Framework Configuration | Configure Code Access Security Policy (same as Runtime Security Policy. Then select Adjust Zone Security, the checkbox 'Make changes to this computer', and then Local Intranet. You can change it to 'Full Trust' and then run your code again. Be careful, and make sure you know what you are doing. You can reset it back to what it was after you have been able to test your code to see if that is your problem. Gaulles

        I Offline
        I Offline
        imran_rafique
        wrote on last edited by
        #3

        thanks for replay i will check it . then reply you. r00d0034@yahoo.com

        1 Reply Last reply
        0
        • G Gaul

          You need to check your security/permissions for the network drive. Dot Net has code access security that checks to see if the code is running from or is loaded from an authorized location. The default security policy setting does not allow you to load and execute code from a network drive. To see if that is your problem, go to Administrative Tools | .NET Framework Configuration | Configure Code Access Security Policy (same as Runtime Security Policy. Then select Adjust Zone Security, the checkbox 'Make changes to this computer', and then Local Intranet. You can change it to 'Full Trust' and then run your code again. Be careful, and make sure you know what you are doing. You can reset it back to what it was after you have been able to test your code to see if that is your problem. Gaulles

          I Offline
          I Offline
          imran_rafique
          wrote on last edited by
          #4

          i am using code Access security police tool (caspol.exe). when i execute this command caspol -machine -addfulltrust WinService1.exe then the following message display on command prompt. ----------------------------------------------------------Microsoft (R) .NET Framework CasPol 1.0.3705.0 Copyright (C) Microsoft Corporation 1998-2001. All rights reserved. ERROR: This assembly is not strong name signed Usage: caspol ... caspol -af caspol -addfulltrust Add full trust assembly to policy level ----------------------------------------------------------i know that strong name tool(sn.exe). but i could not understand which options and arguments i have to use in order to remove the following error ----------------------------------------------- ERROR: This assembly is not strong name signed ----------------------------------------------- can you tell the command with correct option and arguments ? i will be very thank full to to you. r00d0034@yahoo.com

          G 1 Reply Last reply
          0
          • I imran_rafique

            i am using code Access security police tool (caspol.exe). when i execute this command caspol -machine -addfulltrust WinService1.exe then the following message display on command prompt. ----------------------------------------------------------Microsoft (R) .NET Framework CasPol 1.0.3705.0 Copyright (C) Microsoft Corporation 1998-2001. All rights reserved. ERROR: This assembly is not strong name signed Usage: caspol ... caspol -af caspol -addfulltrust Add full trust assembly to policy level ----------------------------------------------------------i know that strong name tool(sn.exe). but i could not understand which options and arguments i have to use in order to remove the following error ----------------------------------------------- ERROR: This assembly is not strong name signed ----------------------------------------------- can you tell the command with correct option and arguments ? i will be very thank full to to you. r00d0034@yahoo.com

            G Offline
            G Offline
            Gaul
            wrote on last edited by
            #5

            You use the sn.exe to generate a signed name key file, but you also need to add the key file to your assembly. If you created your project with VS.NET, you should have an AssemblyInfo.cs which contains a number of attributes. In your AssemblyInfo.cs, modify the AssemblyKeyFile attribute to include your key file as follows depending on the location of your key file: [assembly: AssemblyKeyFile(@"..\..\keyfile.snk")] or [assembly: AssemblyKeyFile(@"keyfile.snk")] Gaulles http://www.gaulles.com

            I 1 Reply Last reply
            0
            • G Gaul

              You use the sn.exe to generate a signed name key file, but you also need to add the key file to your assembly. If you created your project with VS.NET, you should have an AssemblyInfo.cs which contains a number of attributes. In your AssemblyInfo.cs, modify the AssemblyKeyFile attribute to include your key file as follows depending on the location of your key file: [assembly: AssemblyKeyFile(@"..\..\keyfile.snk")] or [assembly: AssemblyKeyFile(@"keyfile.snk")] Gaulles http://www.gaulles.com

              I Offline
              I Offline
              imran_rafique
              wrote on last edited by
              #6

              After doing this work c# portion exceusted sucessfully but process on the network still throw same exception. ---------------------------------------- sn -k mykey.snk [assembly:KeyFileAttribute("mykey.snk")] ----------------------------------------- but ther is a problem with vc++.net(managed code) this portion does not execute i dont know why. is there any other step to perform plz tell ? r00d0034@yahoo.com

              G 1 Reply Last reply
              0
              • I imran_rafique

                After doing this work c# portion exceusted sucessfully but process on the network still throw same exception. ---------------------------------------- sn -k mykey.snk [assembly:KeyFileAttribute("mykey.snk")] ----------------------------------------- but ther is a problem with vc++.net(managed code) this portion does not execute i dont know why. is there any other step to perform plz tell ? r00d0034@yahoo.com

                G Offline
                G Offline
                Gaul
                wrote on last edited by
                #7

                What is the Exception you are getting? Also, when you say that the C# portion executed successfully, what do you mean exactly. Can you provide more details. If possible, can you post appropriate sections of your code to make things clearer? Gaulles http://www.gaulles.com

                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