Local Machine policy exceptions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael

    #1

    Local Machine policy exceptions

    I am running an application that requires "Full Trust" which is declared in
    the assembly.

    How do I trap for the System.Security .Policy.PolicyE xception that is raised
    by a local machines CAS if its current policy will not allow "Full Trust",
    ie its running in the Intranet Zone.

    I am trying to trap the error to advise users to have adm revise policy to
    permit running the program otherwise a cryptic debug screen is raised.

    Thanks

    Mike



  • Vagabond Software

    #2
    Re: Local Machine policy exceptions

    "Michael" <mconnolly4@hou ston.rr.com> wrote in message
    news:8nPHf.1581 4$7y1.2204@torn ado.texas.rr.co m...[color=blue]
    >I am running an application that requires "Full Trust" which is declared in
    >the assembly.
    >
    > How do I trap for the System.Security .Policy.PolicyE xception that is
    > raised by a local machines CAS if its current policy will not allow "Full
    > Trust", ie its running in the Intranet Zone.
    >
    > I am trying to trap the error to advise users to have adm revise policy to
    > permit running the program otherwise a cryptic debug screen is raised.
    >
    > Thanks
    >
    > Mike[/color]

    A code snippet of the offending calls would be helpful. Have you tried:

    Try
    'instantiate full trust objects, invoke full trust methods,
    ' or access full trust properties
    Catch (pe As System.Security .Policy.PolicyE xception)
    Dim message As String = pe.Message
    'or
    Dim message As String = "Talk to your Admin."
    Throw New Exception(messa ge)
    Finally
    'if appropriate
    fullTrustObject s.Dispose
    End Try

    Let me know how that works or if you need more help.

    carl


    Comment

    • Cerebrus99

      #3
      Re: Local Machine policy exceptions

      Hi,

      In the unlikely event that your question is not answered satisfactorily in
      this group, there is another group you might try posting to -
      "microsoft.publ ic.dotnet.secur ity."

      Regards,

      Cerebrus.

      "Vagabond Software" <vagabondsw-X-@-X-gmail.com> wrote in message
      news:OdfNURLMGH A.3944@tk2msftn gp13.phx.gbl...[color=blue]
      > "Michael" <mconnolly4@hou ston.rr.com> wrote in message
      > news:8nPHf.1581 4$7y1.2204@torn ado.texas.rr.co m...[color=green]
      > >I am running an application that requires "Full Trust" which is declared[/color][/color]
      in[color=blue][color=green]
      > >the assembly.
      > >
      > > How do I trap for the System.Security .Policy.PolicyE xception that is
      > > raised by a local machines CAS if its current policy will not allow[/color][/color]
      "Full[color=blue][color=green]
      > > Trust", ie its running in the Intranet Zone.
      > >
      > > I am trying to trap the error to advise users to have adm revise policy[/color][/color]
      to[color=blue][color=green]
      > > permit running the program otherwise a cryptic debug screen is raised.
      > >
      > > Thanks
      > >
      > > Mike[/color]
      >
      > A code snippet of the offending calls would be helpful. Have you tried:
      >
      > Try
      > 'instantiate full trust objects, invoke full trust methods,
      > ' or access full trust properties
      > Catch (pe As System.Security .Policy.PolicyE xception)
      > Dim message As String = pe.Message
      > 'or
      > Dim message As String = "Talk to your Admin."
      > Throw New Exception(messa ge)
      > Finally
      > 'if appropriate
      > fullTrustObject s.Dispose
      > End Try
      >
      > Let me know how that works or if you need more help.
      >
      > carl
      >
      >[/color]


      Comment

      • Mike C

        #4
        Re: Local Machine policy exceptions

        Carl

        Thanks for the reply

        Following is a code snippet from my main sub. The policy ecxception error
        which is picked up by the local machine arises at the first call to to get
        system and environment information.

        The CAS then throws up the debug screen locally before the "catch" can
        activate

        code follows:

        Public Sub Main()
        '
        'Allow XP style Forms to be viewed on User screen
        Application.Ena bleVisualStyles ()
        Application.DoE vents()
        '
        'Get the user and machine environment data
        '
        Try
        Get_UserSystemI nfo(USER_PROCES SOR_TYPE)
        Get_UserEnviron ment(USER_NAME, USER_OSVersion, USER_MACHINE_NA ME)

        Try
        'Windows 2000, XP
        Get_UserMemoryS tatusEX(USER_SY STEM_MEMORYEX,
        USER_AVAILABLE_ SYSTEM_MEMORYEX )

        Catch ex As Exception
        ' Do Nothing if API call fails
        End Try
        '
        Catch ex As System.Security .Policy.PolicyE xception
        '
        'if the user has installed the program on one computer within a network
        'environment and attempts to run the program from a different machine
        within
        'the network then the system.permissi ons exception will be caught here.
        '
        MessageBox.Show (Get_Msg("50019 ", "", "", "", ""), _
        "Name", MessageBoxButto ns.OK, MessageBoxIcon. Error)
        '
        'terminate the program
        End
        '

        Catch ex As Exception
        '
        'if the user has installed the program on one computer within a network
        'environment and attempts to run the program from a different machine
        within
        'the network then the system.permissi ons exception will be caught here.
        '
        MessageBox.Show (Get_Msg("50019 ", "", "", "", ""), _
        "Name", MessageBoxButto ns.OK, MessageBoxIcon. Error)
        '
        'terminate the program
        End
        '
        End Try

        etc
        etc

        end sub



        "Vagabond Software" wrote:
        [color=blue]
        > "Michael" <mconnolly4@hou ston.rr.com> wrote in message
        > news:8nPHf.1581 4$7y1.2204@torn ado.texas.rr.co m...[color=green]
        > >I am running an application that requires "Full Trust" which is declared in
        > >the assembly.
        > >
        > > How do I trap for the System.Security .Policy.PolicyE xception that is
        > > raised by a local machines CAS if its current policy will not allow "Full
        > > Trust", ie its running in the Intranet Zone.
        > >
        > > I am trying to trap the error to advise users to have adm revise policy to
        > > permit running the program otherwise a cryptic debug screen is raised.
        > >
        > > Thanks
        > >
        > > Mike[/color]
        >
        > A code snippet of the offending calls would be helpful. Have you tried:
        >
        > Try
        > 'instantiate full trust objects, invoke full trust methods,
        > ' or access full trust properties
        > Catch (pe As System.Security .Policy.PolicyE xception)
        > Dim message As String = pe.Message
        > 'or
        > Dim message As String = "Talk to your Admin."
        > Throw New Exception(messa ge)
        > Finally
        > 'if appropriate
        > fullTrustObject s.Dispose
        > End Try
        >
        > Let me know how that works or if you need more help.
        >
        > carl
        >
        >
        >[/color]

        Comment

        • Vagabond Software

          #5
          Re: Local Machine policy exceptions

          "Mike C" <MikeC@discussi ons.microsoft.c om> wrote in message
          news:22CF49E2-ED1E-47E6-88D4-4F73C8FC22D7@mi crosoft.com...[color=blue]
          > Carl
          >
          > Thanks for the reply
          >
          > Following is a code snippet from my main sub. The policy ecxception error
          > which is picked up by the local machine arises at the first call to to
          > get
          > system and environment information.
          >
          > The CAS then throws up the debug screen locally before the "catch" can
          > activate
          >
          > code follows:
          >
          > Public Sub Main()
          > '
          > 'Allow XP style Forms to be viewed on User screen
          > Application.Ena bleVisualStyles ()
          > Application.DoE vents()
          > '
          > 'Get the user and machine environment data
          > '
          > Try
          > Get_UserSystemI nfo(USER_PROCES SOR_TYPE)
          > Get_UserEnviron ment(USER_NAME, USER_OSVersion, USER_MACHINE_NA ME)
          >
          > Try
          > 'Windows 2000, XP
          > Get_UserMemoryS tatusEX(USER_SY STEM_MEMORYEX,
          > USER_AVAILABLE_ SYSTEM_MEMORYEX )
          >
          > Catch ex As Exception
          > ' Do Nothing if API call fails
          > End Try
          > '
          > Catch ex As System.Security .Policy.PolicyE xception
          > '
          > 'if the user has installed the program on one computer within a
          > network
          > 'environment and attempts to run the program from a different machine
          > within
          > 'the network then the system.permissi ons exception will be caught
          > here.
          > '
          > MessageBox.Show (Get_Msg("50019 ", "", "", "", ""), _
          > "Name", MessageBoxButto ns.OK, MessageBoxIcon. Error)
          > '
          > 'terminate the program
          > End
          > '
          >
          > Catch ex As Exception
          > '
          > 'if the user has installed the program on one computer within a
          > network
          > 'environment and attempts to run the program from a different machine
          > within
          > 'the network then the system.permissi ons exception will be caught
          > here.
          > '
          > MessageBox.Show (Get_Msg("50019 ", "", "", "", ""), _
          > "Name", MessageBoxButto ns.OK, MessageBoxIcon. Error)
          > '
          > 'terminate the program
          > End
          > '
          > End Try
          >
          > etc
          > etc
          >
          > end sub[/color]

          Mike,

          That code looks like it should be working. Are your Get methods making
          calls into another assembly? Is your .NET security configured correctly for
          that application?

          http://www.code-magazine.com/article...0405031&page=1

          carl


          Comment

          • Michael

            #6
            Re: Local Machine policy exceptions

            Carl

            Once again thanks - working on this for several days and getting nowhere

            Here's the info you asked for. Note that I included the both GET subs in
            their entirety even though this program only extracts limited info needed.

            Also note
            a) if I set the local machine Intranet zone permissions to "Full Trust"
            program works without generating a policy exception
            b)if I create a new zone with "Full Trust" and import the program "key" the
            program works without generating a policy exception

            Assembly - Security and Signing Follows:

            'Sign the Assembly
            'strong name key [MyProgram.snk] created with sn.exe. Key must reside
            'in the same folder as the Visual Studio Project.
            <Assembly: AssemblyKeyFile Attribute("MyPr ogram.snk")>
            '
            'Deploy the Assembly requesting FullTrust Permissions
            '<Assembly: PermissionSetAt tribute(Securit yAction.Request Minimum,
            Name:="FullTrus t")>

            The two Get subs Follow:

            1)Get System Info

            'Use Windows API to get User System Memory Status
            Public Declare Sub GetSystemInfo Lib "kernel32.d ll" (ByRef lpSystemInfo As
            SYSTEM_INFO)

            Public Sub Get_UserSystemI nfo(ByRef ProcessorType As String)

            Dim SysInfo As SYSTEM_INFO
            GetSystemInfo(S ysInfo)

            Dim UserProcessorTy pe As String = SysInfo.dwProce ssorType.ToStri ng

            ProcessorType = UserProcessorTy pe

            End Sub

            2)Get User Environment

            Public Sub Get_UserEnviron ment(ByRef Name As String, ByRef OSversion As
            String, ByRef MachineName As String)

            'PROCESS
            Dim UserProcess As Process = Process.GetCurr entProcess

            Dim UserProgramName As String = UserProcess.Pro cessName
            Dim UserPagednoMem As Long = UserProcess.Non pagedSystemMemo rySize
            Dim UserPagedMem As Long = UserProcess.Pag edMemorySize
            Dim UserPagedpeakMe m As Long = UserProcess.Pea kPagedMemorySiz e
            Dim UserPagedsysMem As Long = UserProcess.Pag edSystemMemoryS ize
            Dim UserPeakMem As Long = UserProcess.Pea kWorkingSet
            Dim UserPrivateMem As Long = UserProcess.Pri vateMemorySize

            'PROCESS MODULE
            'The following retrieves the name of the Program
            'base module and all dll's loaded with the process
            'along with their physical size and other properties.
            Dim UserProcessModu le As ProcessModule
            Dim UserProcessModu leCollection As ProcessModuleCo llection =
            UserProcess.Mod ules
            'example - get memory used by loaded dll modules
            'ModuleMemorySi ze does not include any additional
            'memory allocations that the module makes once
            'it is running; it includes only the size of the
            'static code and data in the module file.
            'The Base Module represents the static program code.
            Dim i As Integer
            Dim total As Integer
            For i = 0 To UserProcessModu leCollection.Co unt - 1
            UserProcessModu le = UserProcessModu leCollection(i)
            total = total + UserProcessModu le.ModuleMemory Size
            Next

            'ENVIRONMENT
            'Gets the amount of physical memory mapped to
            'the process context.
            Dim UserMemory As Long
            UserMemory = Environment.Wor kingSet

            'Gets the NetBIOS name of this local computer.
            Dim UserMachineName As String
            UserMachineName = Environment.Mac hineName

            'Gets an OperatingSystem object that contains the
            'current platform identifier and version number.
            Dim UserOSVersion As String
            UserOSVersion = Environment.OSV ersion.ToString

            'Gets the fully qualified path of the system directory
            Dim UserSysDirector y As String = Environment.Sys temDirectory

            'Gets the user name of the person who started the
            'current thread
            Dim UserName As String
            UserName = Environment.Use rName

            'Returns an array of string containing the names of
            'the logical drives on the current computer, i.e.,
            '"A:\", "C:\" etc
            Dim UserLogicalDriv es As String()
            UserLogicalDriv es = Environment.Get LogicalDrives

            'The system special folders are folders such as Program Files,
            'Programs, System, or Startup, which contain common
            'information. Special folders are set by default by the
            'system, or explicitly by the user, when installing a version
            'of Windows.
            'The GetFolderPath method uses these enumerated constants
            'to designate the special folder path to retrieve
            Dim UserFolder As String
            UserFolder =
            Environment.Get FolderPath(Envi ronment.Special Folder.Applicat ionData)
            'etc, etc.

            'The following statement accesses network, logon
            'and other user type data. Iterate as needed to
            'look at the variables - 36 Total
            Dim UserEnvironment Variables As System.Collecti ons.IDictionary
            UserEnvironment Variables = Environment.Get EnvironmentVari ables()
            '
            'Dim de As DictionaryEntry
            'For Each de In environmentVari ables
            ' Console.WriteLi ne(" {0} = {1}", de.Key, de.Value)
            'Next de

            'return the desired data
            Name = UserName
            OSversion = UserOSVersion
            MachineName = UserMachineName

            End Sub

            Regards and thanks

            Mike



            "Vagabond Software" <vagabondsw-X-@-X-gmail.com> wrote in message
            news:OhjGAfSMGH A.500@TK2MSFTNG P15.phx.gbl...[color=blue]
            > "Mike C" <MikeC@discussi ons.microsoft.c om> wrote in message
            > news:22CF49E2-ED1E-47E6-88D4-4F73C8FC22D7@mi crosoft.com...[color=green]
            >> Carl
            >>
            >> Thanks for the reply
            >>
            >> Following is a code snippet from my main sub. The policy ecxception error
            >> which is picked up by the local machine arises at the first call to to
            >> get
            >> system and environment information.
            >>
            >> The CAS then throws up the debug screen locally before the "catch" can
            >> activate
            >>
            >> code follows:
            >>
            >> Public Sub Main()
            >> '
            >> 'Allow XP style Forms to be viewed on User screen
            >> Application.Ena bleVisualStyles ()
            >> Application.DoE vents()
            >> '
            >> 'Get the user and machine environment data
            >> '
            >> Try
            >> Get_UserSystemI nfo(USER_PROCES SOR_TYPE)
            >> Get_UserEnviron ment(USER_NAME, USER_OSVersion, USER_MACHINE_NA ME)
            >>
            >> Try
            >> 'Windows 2000, XP
            >> Get_UserMemoryS tatusEX(USER_SY STEM_MEMORYEX,
            >> USER_AVAILABLE_ SYSTEM_MEMORYEX )
            >>
            >> Catch ex As Exception
            >> ' Do Nothing if API call fails
            >> End Try
            >> '
            >> Catch ex As System.Security .Policy.PolicyE xception
            >> '
            >> 'if the user has installed the program on one computer within a
            >> network
            >> 'environment and attempts to run the program from a different
            >> machine
            >> within
            >> 'the network then the system.permissi ons exception will be caught
            >> here.
            >> '
            >> MessageBox.Show (Get_Msg("50019 ", "", "", "", ""), _
            >> "Name", MessageBoxButto ns.OK, MessageBoxIcon. Error)
            >> '
            >> 'terminate the program
            >> End
            >> '
            >>
            >> Catch ex As Exception
            >> '
            >> 'if the user has installed the program on one computer within a
            >> network
            >> 'environment and attempts to run the program from a different
            >> machine
            >> within
            >> 'the network then the system.permissi ons exception will be caught
            >> here.
            >> '
            >> MessageBox.Show (Get_Msg("50019 ", "", "", "", ""), _
            >> "Name", MessageBoxButto ns.OK, MessageBoxIcon. Error)
            >> '
            >> 'terminate the program
            >> End
            >> '
            >> End Try
            >>
            >> etc
            >> etc
            >>
            >> end sub[/color]
            >
            > Mike,
            >
            > That code looks like it should be working. Are your Get methods making
            > calls into another assembly? Is your .NET security configured correctly
            > for that application?
            >
            > http://www.code-magazine.com/article...0405031&page=1
            >
            > carl
            >[/color]


            Comment

            • Michael

              #7
              Re: Local Machine policy exceptions

              Carl
              ignore the " ' " in front of the assembly in the info below ie line should
              read
              <Assembly: PermissionSetAt tribute(Securit yAction.Request Minimum,
              Name:="FullTrus t")> Had commented it out trying to solve issue with no luck
              Mike

              "Michael" <mconnolly4@hou ston.rr.com> wrote in message
              news:yNiIf.1822 6$7y1.5241@torn ado.texas.rr.co m...[color=blue]
              > Carl
              >
              > Once again thanks - working on this for several days and getting nowhere
              >
              > Here's the info you asked for. Note that I included the both GET subs in
              > their entirety even though this program only extracts limited info needed.
              >
              > Also note
              > a) if I set the local machine Intranet zone permissions to "Full Trust"
              > program works without generating a policy exception
              > b)if I create a new zone with "Full Trust" and import the program "key"
              > the program works without generating a policy exception
              >
              > Assembly - Security and Signing Follows:
              >
              > 'Sign the Assembly
              > 'strong name key [MyProgram.snk] created with sn.exe. Key must reside
              > 'in the same folder as the Visual Studio Project.
              > <Assembly: AssemblyKeyFile Attribute("MyPr ogram.snk")>
              > '
              > 'Deploy the Assembly requesting FullTrust Permissions
              > '<Assembly: PermissionSetAt tribute(Securit yAction.Request Minimum,
              > Name:="FullTrus t")>
              >
              > The two Get subs Follow:
              >
              > 1)Get System Info
              >
              > 'Use Windows API to get User System Memory Status
              > Public Declare Sub GetSystemInfo Lib "kernel32.d ll" (ByRef lpSystemInfo
              > As SYSTEM_INFO)
              >
              > Public Sub Get_UserSystemI nfo(ByRef ProcessorType As String)
              >
              > Dim SysInfo As SYSTEM_INFO
              > GetSystemInfo(S ysInfo)
              >
              > Dim UserProcessorTy pe As String = SysInfo.dwProce ssorType.ToStri ng
              >
              > ProcessorType = UserProcessorTy pe
              >
              > End Sub
              >
              > 2)Get User Environment
              >
              > Public Sub Get_UserEnviron ment(ByRef Name As String, ByRef OSversion As
              > String, ByRef MachineName As String)
              >
              > 'PROCESS
              > Dim UserProcess As Process = Process.GetCurr entProcess
              >
              > Dim UserProgramName As String = UserProcess.Pro cessName
              > Dim UserPagednoMem As Long = UserProcess.Non pagedSystemMemo rySize
              > Dim UserPagedMem As Long = UserProcess.Pag edMemorySize
              > Dim UserPagedpeakMe m As Long = UserProcess.Pea kPagedMemorySiz e
              > Dim UserPagedsysMem As Long = UserProcess.Pag edSystemMemoryS ize
              > Dim UserPeakMem As Long = UserProcess.Pea kWorkingSet
              > Dim UserPrivateMem As Long = UserProcess.Pri vateMemorySize
              >
              > 'PROCESS MODULE
              > 'The following retrieves the name of the Program
              > 'base module and all dll's loaded with the process
              > 'along with their physical size and other properties.
              > Dim UserProcessModu le As ProcessModule
              > Dim UserProcessModu leCollection As ProcessModuleCo llection =
              > UserProcess.Mod ules
              > 'example - get memory used by loaded dll modules
              > 'ModuleMemorySi ze does not include any additional
              > 'memory allocations that the module makes once
              > 'it is running; it includes only the size of the
              > 'static code and data in the module file.
              > 'The Base Module represents the static program code.
              > Dim i As Integer
              > Dim total As Integer
              > For i = 0 To UserProcessModu leCollection.Co unt - 1
              > UserProcessModu le = UserProcessModu leCollection(i)
              > total = total + UserProcessModu le.ModuleMemory Size
              > Next
              >
              > 'ENVIRONMENT
              > 'Gets the amount of physical memory mapped to
              > 'the process context.
              > Dim UserMemory As Long
              > UserMemory = Environment.Wor kingSet
              >
              > 'Gets the NetBIOS name of this local computer.
              > Dim UserMachineName As String
              > UserMachineName = Environment.Mac hineName
              >
              > 'Gets an OperatingSystem object that contains the
              > 'current platform identifier and version number.
              > Dim UserOSVersion As String
              > UserOSVersion = Environment.OSV ersion.ToString
              >
              > 'Gets the fully qualified path of the system directory
              > Dim UserSysDirector y As String = Environment.Sys temDirectory
              >
              > 'Gets the user name of the person who started the
              > 'current thread
              > Dim UserName As String
              > UserName = Environment.Use rName
              >
              > 'Returns an array of string containing the names of
              > 'the logical drives on the current computer, i.e.,
              > '"A:\", "C:\" etc
              > Dim UserLogicalDriv es As String()
              > UserLogicalDriv es = Environment.Get LogicalDrives
              >
              > 'The system special folders are folders such as Program Files,
              > 'Programs, System, or Startup, which contain common
              > 'information. Special folders are set by default by the
              > 'system, or explicitly by the user, when installing a version
              > 'of Windows.
              > 'The GetFolderPath method uses these enumerated constants
              > 'to designate the special folder path to retrieve
              > Dim UserFolder As String
              > UserFolder =
              > Environment.Get FolderPath(Envi ronment.Special Folder.Applicat ionData)
              > 'etc, etc.
              >
              > 'The following statement accesses network, logon
              > 'and other user type data. Iterate as needed to
              > 'look at the variables - 36 Total
              > Dim UserEnvironment Variables As System.Collecti ons.IDictionary
              > UserEnvironment Variables = Environment.Get EnvironmentVari ables()
              > '
              > 'Dim de As DictionaryEntry
              > 'For Each de In environmentVari ables
              > ' Console.WriteLi ne(" {0} = {1}", de.Key, de.Value)
              > 'Next de
              >
              > 'return the desired data
              > Name = UserName
              > OSversion = UserOSVersion
              > MachineName = UserMachineName
              >
              > End Sub
              >
              > Regards and thanks
              >
              > Mike
              >
              >
              >
              > "Vagabond Software" <vagabondsw-X-@-X-gmail.com> wrote in message
              > news:OhjGAfSMGH A.500@TK2MSFTNG P15.phx.gbl...[color=green]
              >> "Mike C" <MikeC@discussi ons.microsoft.c om> wrote in message
              >> news:22CF49E2-ED1E-47E6-88D4-4F73C8FC22D7@mi crosoft.com...[color=darkred]
              >>> Carl
              >>>
              >>> Thanks for the reply
              >>>
              >>> Following is a code snippet from my main sub. The policy ecxception
              >>> error
              >>> which is picked up by the local machine arises at the first call to to
              >>> get
              >>> system and environment information.
              >>>
              >>> The CAS then throws up the debug screen locally before the "catch" can
              >>> activate
              >>>
              >>> code follows:
              >>>
              >>> Public Sub Main()
              >>> '
              >>> 'Allow XP style Forms to be viewed on User screen
              >>> Application.Ena bleVisualStyles ()
              >>> Application.DoE vents()
              >>> '
              >>> 'Get the user and machine environment data
              >>> '
              >>> Try
              >>> Get_UserSystemI nfo(USER_PROCES SOR_TYPE)
              >>> Get_UserEnviron ment(USER_NAME, USER_OSVersion, USER_MACHINE_NA ME)
              >>>
              >>> Try
              >>> 'Windows 2000, XP
              >>> Get_UserMemoryS tatusEX(USER_SY STEM_MEMORYEX,
              >>> USER_AVAILABLE_ SYSTEM_MEMORYEX )
              >>>
              >>> Catch ex As Exception
              >>> ' Do Nothing if API call fails
              >>> End Try
              >>> '
              >>> Catch ex As System.Security .Policy.PolicyE xception
              >>> '
              >>> 'if the user has installed the program on one computer within a
              >>> network
              >>> 'environment and attempts to run the program from a different
              >>> machine
              >>> within
              >>> 'the network then the system.permissi ons exception will be caught
              >>> here.
              >>> '
              >>> MessageBox.Show (Get_Msg("50019 ", "", "", "", ""), _
              >>> "Name", MessageBoxButto ns.OK, MessageBoxIcon. Error)
              >>> '
              >>> 'terminate the program
              >>> End
              >>> '
              >>>
              >>> Catch ex As Exception
              >>> '
              >>> 'if the user has installed the program on one computer within a
              >>> network
              >>> 'environment and attempts to run the program from a different
              >>> machine
              >>> within
              >>> 'the network then the system.permissi ons exception will be caught
              >>> here.
              >>> '
              >>> MessageBox.Show (Get_Msg("50019 ", "", "", "", ""), _
              >>> "Name", MessageBoxButto ns.OK, MessageBoxIcon. Error)
              >>> '
              >>> 'terminate the program
              >>> End
              >>> '
              >>> End Try
              >>>
              >>> etc
              >>> etc
              >>>
              >>> end sub[/color]
              >>
              >> Mike,
              >>
              >> That code looks like it should be working. Are your Get methods making
              >> calls into another assembly? Is your .NET security configured correctly
              >> for that application?
              >>
              >> http://www.code-magazine.com/article...0405031&page=1
              >>
              >> carl
              >>[/color]
              >
              >[/color]


              Comment

              Working...