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
U

U P G R A Y E D D

@U P G R A Y E D D
About
Posts
3
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • To exit application
    U U P G R A Y E D D

    was pressed, or because the login process completed and it's time to move onto different things, without exiting the application.

    C# help

  • Problems getting method called correctly
    U U P G R A Y E D D

    You are using the variables firstNum and secondNum, and have not assigned them a value. Local variables must have a value assigned to them before they can be used. You said something receives two numbers and parses them into ints, I can only assume it looks like this: Int32.Parse(strFirstNumber); Int32.Parse(strSecondNumber); Well, when you do that you must not be storing those values into either firstNum or secondNum. So after declaring firstNum and secondNum, aka "int firstNum, secondNum;" you need to say something like: firstNum = Int32.Parse(strFirstNumber); secondNum = Int32.Parse(strSecondNumber); Then call: DetermineNumberSum(firstNum, secondNum);

    C# csharp help question learning

  • Emit private field get/set (FieldAccessException) [modified]
    U U P G R A Y E D D

    I'm working on a serializer and I've run into an issue with private field access. When I emit and run the IL code to access the private field of a class, it results in a FieldAccessException. I've gone looking for information on this but found very little. One of the suggestions was that the class I emit, that has the code that accesses the private fields must be have a special permissions attribute. So I added the following to my type builder for the class: Type[] ctorParams = new Type[] { typeof(SecurityAction) }; ConstructorInfo ci = typeof(ReflectionPermissionAttribute).GetConstructor(ctorParams); PropertyInfo pi = typeof(ReflectionPermissionAttribute).GetProperty("Unrestricted"); CustomAttributeBuilder cab = new CustomAttributeBuilder(ci, new object[] { SecurityAction.Assert }, new PropertyInfo[] { pi }, new object[] { true }); typeBuilder.SetCustomAttribute(cab); However, this still results in the same FieldAccessException. Does anyone have any experience with private field access via the ILGenerator, and could shed some light on this for me, I would be very happy. I've also tried: typeBuilder.AddDeclarativeSecurity(SecurityAction.Demand, new PermissionSet(PermissionState.Unrestricted)); With the same result.

    C# dotnet help
  • Login

  • Don't have an account? Register

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