Results 1 to 5 of 5

Thread: Error - "Operator '|' cannot be applied to operands of type...

Hybrid View

  1. #1
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497

    Re: Error - "Operator '|' cannot be applied to operands of type...

    Instead of Int32's in the first code section, you should probably try using uint's.

    Then you should be able to OR them.
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Oct 2009
    Location
    Oshawa
    Posts
    214

    Re: Error - "Operator '|' cannot be applied to operands of type...

    I tried changing to private enum ACCESS_MASK : int but this didn't work.

    I also changed all the datatypes from int32 to uint including SC_MANAGER_ALL_ACCESS but then the error changes to "Operator '|' cannot be applied to operands of type 'WindowsService.ACCESS_MASK' and 'uint' "

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2009
    Location
    Oshawa
    Posts
    214

    Re: Error - "Operator '|' cannot be applied to operands of type...

    Ok, nevermind. LoL. I fixed it.

    Code:
    private const Int32 SC_MANAGER_ALL_ACCESS = (Int32)ACCESS_MASK.STANDARD_RIGHTS_REQUIRED | SC_MANAGER_CONNECT | SC_MANAGER_CREATE_SERVICE | SC_MANAGER_ENUMERATE_SERVICE | SC_MANAGER_LOCK | SC_MANAGER_QUERY_LOCK_STATUS | SC_MANAGER_MODIFY_BOOT_CONFIG;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width