473,395 Members | 1,937 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Create File in memory...

I am writing an ASP.NET application and I have a class
that I have written to create a vCard...it just returns a
string with all the necessarry info... Anyway...is there
a way that I can create a text file in memory and then
stream it to the browser so that I do not have to create
the file and save it to a temporary location?
Jul 21 '05 #1
4 10801
a
I have a similar issue with Images on web pages, since the rendered <img>
tag must point to a valid URL, and can't be filled with an IMAGE object.

If you have a page whose purpose in life is to create your stream, you can
take the string (or stream) and save it to the pages OutputStream
(MyStream.Save(Response.OutputStream))
Then that page will be the source page for the vCard.

hth

Kevin
"Nicholas Then" <ni**@unitedagy.com> wrote in message
news:07****************************@phx.gbl...
I am writing an ASP.NET application and I have a class
that I have written to create a vCard...it just returns a
string with all the necessarry info... Anyway...is there
a way that I can create a text file in memory and then
stream it to the browser so that I do not have to create
the file and save it to a temporary location?

Jul 21 '05 #2
"Nicholas Then" <ni**@unitedagy.com> a écrit dans le message de
news:07****************************@phx.gbl...
I am writing an ASP.NET application and I have a class
that I have written to create a vCard...it just returns a
string with all the necessarry info... Anyway...is there
a way that I can create a text file in memory and then
stream it to the browser so that I do not have to create
the file and save it to a temporary location?


System.IO.MemoryStream

Arnaud
MVP - VC
Jul 21 '05 #3
Hi!
Michael wrote: "Hello... I need to recover an old backup of a solution
(with 3 projects) that was under source control. ... " Tian Ming Huan wrote: "The following is a listing of the currently supported steps to remove source control information for a VS.NET project:

1. Open the project (or solution) in Visual Studio .NET
2. Click the File menu
3. Click the Source Control menu
4. Click Change Source Control
5. Select the project (or solution), click "unbind"
Michael wrote: "I found a manual way of editing the .proj files..."
Chris wrote: "Could someone post the manual edit (or another solution)?"


I've also encountered the situation mention above. It did - of course -
happen after I had fooled around, and done some counter-intuitive things to
code that was originally bound to source control.

I have the manual fix for the problem:

I got the following error message:
"The solution appears to be under source control, but its binding
information cannot be found. It is possible that the MSSCCPRJ.SCC file or
another item that holds the source control settings for the solution, has
been deleted. Because it is not possible to recover this missing information
automatically, the projects whose bindings are missing will be treated as
not under source control."
.... but when I selected the "Change Source Control" menu option in Visual
Studio .NET 2003, the solution did not seem to be bound to Source Control at
all.

As requested above: These were the steps that I followed to succesfully rid
my solution of _all_ of it's references to Source Control (and the annoying
error message) in a manual way:
1. Delete all the "<projectName>.vbproj.vspscc" project MetaData files. C#
developers should look for the files named "<projectName>.csproj.vspscc"
2. Delete all the "vssver.scc" files (if any).
3. Delete the "<solutionName>.vssscc" file.
4. Open the "<solution>.sln" file in a text editor (such as notepad.exe) and
remove all the information between the following two "Section start/end
identifiers" (including the identifiers):
GlobalSection(SourceCodeControl)
....
EndGlobalSection
5. Open each "<projectName>.vbproj"file (or "<projectName>.csproj"-file
for c# developers) in a notepad.exe style editor. Remove all entries similar
to the ones below.
SccProjectName = ...
SccLocalPath = ...
SccAuxPath = ...
SccProvider = ...

It's quite likely that you don't have to do all of the above (maybe just
#4.& #5.) in order to rid yourself of the annoying pop-up. Go through all
the steps and you're guaranteed to be liberated from source control.

sincerely,
Simen Sandelien
http://konsulent.sandelien.no
Jul 21 '05 #4
Cor
Hi Nicholas

A sample with an image in a dataset (vb)
If you are using C# is the only difference is the declarations
\\\
Dim arr() As Byte = CType(Ds.tables(0).Rows(0)("Photo"), Byte())
Dim ms As New IO.MemoryStream(arr)
Dim im As Image = Image.FromStream(ms)
///

I hope this helps?

Cor
I am writing an ASP.NET application and I have a class
that I have written to create a vCard...it just returns a
string with all the necessarry info... Anyway...is there
a way that I can create a text file in memory and then
stream it to the browser so that I do not have to create
the file and save it to a temporary location?

Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Justin | last post by:
Hi, I am continualy receiving the following type of error in my browser from programs using php/mysql Warning: mysql_connect(): Can't create a new thread (errno 11). If you are not out of...
4
by: Frank Millman | last post by:
Hi all I need to generate potentially large reports from a database, and I want to offer the option of print preview before actually printing (using wxPython). I figure that the best way to...
1
by: John | last post by:
Greetings microsoft.public.dotnet.general, Here is my problem: my boss wants to create a PDF file for our clients that they can open (without entering a password) that cannot be viewed or...
4
by: Lokicer | last post by:
Hi all, i want to create a file in memory and access the memory block like a file(i/o function) in windows 2000. Any hlep are appreciated. Regards, Zheng
1
by: Amy L. | last post by:
I am working on creating a web service that will create a signed xml file. I would like to create this file in memory and than somehow email it to the user that requested it to be generated. I...
13
by: Daniel Walzenbach | last post by:
Hi, Imagine the following situation: I have an asp.net application which allows uploading files to a SQL Server 2000 database (Files are stored as type "images"). As a next step I would like to...
34
by: Tom | last post by:
I'd greatly appreciate advice and code snippets on how to create a ram disk within a C/C++ program. I also need to be able to determine the free space. Thanks in advance for any help.
23
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these...
5
by: Nitin Mahajan | last post by:
Guys Is there a way in C# to create a word object directly from a memory stream without passing that to hard disk (file stream). I think it doesn't makes sense to create a file just to read it...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.