473,323 Members | 1,570 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,323 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 10799
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.