Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 21st, 2007, 12:17 AM
Authorized User
 
Join Date: Jan 2007
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default httpresponse in console application in VB.NET 1.1



I m writing this code in VB.NET web application to set the MIME type for some particular file extensions.It working fine but what
i want to do is i don't want the web application I want this code in vb.net 1.1 console application.Is it possible to use httpresponse in
console application?
        Dim fs As System.IO.FileStream = Nothing
        fs = System.IO.File.Open("C:\...\test.zip", System.IO.FileMode.Open)
        Dim btFile(fs.Length) As Byte
        fs.Read(btFile, 0, fs.Length)
        fs.Close()

        Response.AddHeader("Content-disposition", "attachment; filename=" + "test.zip")
        Response.ContentType = "application/octet-stream"
        Response.BinaryWrite(btFile)
        Response.End()


 
Old March 21st, 2007, 06:30 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Yes you should be able to use it but make sure you test for a working internet connection because if one isnt present your application will throw an exception.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirect Console Output(VB.Net) danasegarane Visual Studio 2005 1 September 9th, 2007 10:30 AM
Console application but no Console gamotter C# 2 August 22nd, 2007 11:41 PM
Executing vb.net console app via report services rickyc1 BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 2 March 31st, 2006 03:56 AM
Console application and web application nsrujan ASP.NET 1.0 and 1.1 Basics 1 April 16th, 2005 10:35 PM
C#.net console application,leadtools problem on XP not24 General .NET 6 October 31st, 2004 10:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.