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. Window 7 and WebClient Class

Window 7 and WebClient Class

Scheduled Pinned Locked Moved C#
sysadminannouncementxmlhelp
5 Posts 4 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.
  • W Offline
    W Offline
    Wolfram Steinke
    wrote on last edited by
    #1

    I have come across problem for which I'm looking for permanent solution. Some software I'm working needs to have a version checking mechanism for update checking and disabling the installed version if necessary. It was decided to that a server be provided from which a small encrypted xml file is downloaded and checked. I thought, "not too complex with Webclient", simply download the file decrypt and check it and then delete it. If an Exception then status is Unverified. Works file on XP machines when the file is removed from the server the exception happens like expected. On the Windows 7 machine however it continues to succeed and even when the network is disconnected. NO exception is raised. I even took out the try/catch to confirm that - NO crash. If set

    client.CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore);

    just incase, because I wanted to ensure the file was downloaded every time. It is still coming from somewhere. I'm confused!!!!! If anyone has an idea about this I would be interested in knowing about it.

    Happy programming!!

    B realJSOPR RaviBeeR 3 Replies Last reply
    0
    • W Wolfram Steinke

      I have come across problem for which I'm looking for permanent solution. Some software I'm working needs to have a version checking mechanism for update checking and disabling the installed version if necessary. It was decided to that a server be provided from which a small encrypted xml file is downloaded and checked. I thought, "not too complex with Webclient", simply download the file decrypt and check it and then delete it. If an Exception then status is Unverified. Works file on XP machines when the file is removed from the server the exception happens like expected. On the Windows 7 machine however it continues to succeed and even when the network is disconnected. NO exception is raised. I even took out the try/catch to confirm that - NO crash. If set

      client.CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore);

      just incase, because I wanted to ensure the file was downloaded every time. It is still coming from somewhere. I'm confused!!!!! If anyone has an idea about this I would be interested in knowing about it.

      Happy programming!!

      B Offline
      B Offline
      Bernhard Hiller
      wrote on last edited by
      #2

      Where should the exception be thrown - in some places and under certain circumstances exceptions get swallowed! E.g. in a Form Load or Shown event when the application is executed from Visual Studio; or possibly also on Win7 64 bit machines with those events.

      W 1 Reply Last reply
      0
      • W Wolfram Steinke

        I have come across problem for which I'm looking for permanent solution. Some software I'm working needs to have a version checking mechanism for update checking and disabling the installed version if necessary. It was decided to that a server be provided from which a small encrypted xml file is downloaded and checked. I thought, "not too complex with Webclient", simply download the file decrypt and check it and then delete it. If an Exception then status is Unverified. Works file on XP machines when the file is removed from the server the exception happens like expected. On the Windows 7 machine however it continues to succeed and even when the network is disconnected. NO exception is raised. I even took out the try/catch to confirm that - NO crash. If set

        client.CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore);

        just incase, because I wanted to ensure the file was downloaded every time. It is still coming from somewhere. I'm confused!!!!! If anyone has an idea about this I would be interested in knowing about it.

        Happy programming!!

        realJSOPR Offline
        realJSOPR Offline
        realJSOP
        wrote on last edited by
        #3

        I think your only recourse is to run it under the debugger and investigate every variable and condition (in the appropriate block of code) until you find the problem.

        ".45 ACP - because shooting twice is just silly" - JSOP, 2010
        -----
        You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
        -----
        "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997

        1 Reply Last reply
        0
        • W Wolfram Steinke

          I have come across problem for which I'm looking for permanent solution. Some software I'm working needs to have a version checking mechanism for update checking and disabling the installed version if necessary. It was decided to that a server be provided from which a small encrypted xml file is downloaded and checked. I thought, "not too complex with Webclient", simply download the file decrypt and check it and then delete it. If an Exception then status is Unverified. Works file on XP machines when the file is removed from the server the exception happens like expected. On the Windows 7 machine however it continues to succeed and even when the network is disconnected. NO exception is raised. I even took out the try/catch to confirm that - NO crash. If set

          client.CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore);

          just incase, because I wanted to ensure the file was downloaded every time. It is still coming from somewhere. I'm confused!!!!! If anyone has an idea about this I would be interested in knowing about it.

          Happy programming!!

          RaviBeeR Offline
          RaviBeeR Offline
          RaviBee
          wrote on last edited by
          #4

          Did you mean to specify BypassCache instead of NoCacheNoStore?  That's what I use to achieve a similar result and it works fine. /ravi

          My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

          1 Reply Last reply
          0
          • B Bernhard Hiller

            Where should the exception be thrown - in some places and under certain circumstances exceptions get swallowed! E.g. in a Form Load or Shown event when the application is executed from Visual Studio; or possibly also on Win7 64 bit machines with those events.

            W Offline
            W Offline
            Wolfram Steinke
            wrote on last edited by
            #5

            From what I have tracked down, the exception doesn't occur because the 'old' file is actually being served up. It seems that the BranchCache service is being over kind to us and even ignoring the noCacheNoStore request. I shall confirm or otherwise on Tuesday when I'm back at work.

            Happy programming!!

            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