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. Web Development
  3. ASP.NET
  4. [Message Deleted]

[Message Deleted]

Scheduled Pinned Locked Moved ASP.NET
7 Posts 5 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.
  • J Offline
    J Offline
    Junior Boy
    wrote on last edited by
    #1

    [Message Deleted]

    J C S 3 Replies Last reply
    0
    • J Junior Boy

      [Message Deleted]

      J Offline
      J Offline
      Jay_se
      wrote on last edited by
      #2

      Hi,

      Junior Boy wrote:

      Please help me to convert this code to C# .net.

      We can't able to work for you. This forum is only for sharing the knowledge.

      Regards, Jay :)

      J 1 Reply Last reply
      0
      • J Jay_se

        Hi,

        Junior Boy wrote:

        Please help me to convert this code to C# .net.

        We can't able to work for you. This forum is only for sharing the knowledge.

        Regards, Jay :)

        J Offline
        J Offline
        Junior Boy
        wrote on last edited by
        #3

        Hi Jay, Thank you for your replied. And actually I know in this point Yes, sure if I know something that people posted. I would like to reply them too. To me I don't know about VB .net and I just ask for someone who can help me. If they don't want to it's ok but If they do that really appreciate in helping. Regards,

        junior boy

        1 Reply Last reply
        0
        • J Junior Boy

          [Message Deleted]

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          You should use a converter, then work through the bugs. It's really kind of trivial, and a good exercise, to convery a small snippet like this one. A lot of the commercial converters will convert up to 200 lines in their demo mode, you could also try those. Some of this code kind of sucks, actually. You could amortise it into something simpler, it's not that well written.

          Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

          J 1 Reply Last reply
          0
          • C Christian Graus

            You should use a converter, then work through the bugs. It's really kind of trivial, and a good exercise, to convery a small snippet like this one. A lot of the commercial converters will convert up to 200 lines in their demo mode, you could also try those. Some of this code kind of sucks, actually. You could amortise it into something simpler, it's not that well written.

            Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

            J Offline
            J Offline
            Junior Boy
            wrote on last edited by
            #5

            Thank you very much for you suggestion. Finally I got to know and fix all the bugging. This is so appreciate for your comment. Thank you very much,

            junior boy

            1 Reply Last reply
            0
            • J Junior Boy

              [Message Deleted]

              S Offline
              S Offline
              Steven J Jowett
              wrote on last edited by
              #6

              VB.NET Code :- Response.Buffer = True Response.AddHeader("content-disposition", "attachment; filename=MyFile.txt") Const adTypeBinary As Object = 1 Dim BinaryStream As Object BinaryStream = CreateObject("ADODB.Stream") BinaryStream.Type = adTypeBinary BinaryStream.Open() BinaryStream.LoadFromFile("C:\data.txt") Dim BinaryData As Object BinaryData = BinaryStream.Read Response.BinaryWrite(BinaryData) BinaryStream = Nothing Response.End()

              Steve Jowett ------------------------- Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'

              G 1 Reply Last reply
              0
              • S Steven J Jowett

                VB.NET Code :- Response.Buffer = True Response.AddHeader("content-disposition", "attachment; filename=MyFile.txt") Const adTypeBinary As Object = 1 Dim BinaryStream As Object BinaryStream = CreateObject("ADODB.Stream") BinaryStream.Type = adTypeBinary BinaryStream.Open() BinaryStream.LoadFromFile("C:\data.txt") Dim BinaryData As Object BinaryData = BinaryStream.Read Response.BinaryWrite(BinaryData) BinaryStream = Nothing Response.End()

                Steve Jowett ------------------------- Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'

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

                That looks like VB6 code that is just ported to .NET without converting to .NET technology. There is no reason to use a ADODB.Stream object in .NET, there are better stream objects in the .NET framework. You don't even have to use a stream object in .NET to output a file, there are methods for that in the HttpResponse object. Real VB.NET code: Response.Buffer = True Response.AddHeader("content-disposition", "attachment; filename=MyFile.txt") Response.WriteFile("C:\data.txt") Response.End()

                --- single minded; short sighted; long gone;

                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