473,387 Members | 1,407 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,387 software developers and data experts.

Loading a Remote file

Hi,

I want to load contents of a remote HTML file and to display it on the ASP
..NET Web Page. The remote HTML file is not under any virtual folder and the
content & location may vary for each operations.

How can I do the same?

Thanks,
Anbu
Nov 19 '05 #1
7 2342
You can use your code to Access files on the server or in shares that do not
exist in your virtual directories, regarding your ASPNET system account has
sufficient privalges, or the account IIS is using.
This can also be overcome using impersonation.

To load this file, you can include the file in a place holder on the page,
or write the file out using System.IO

Regards

Grant
"Anbu" <An***********************@alcatel.com> wrote in message
news:1122285437.797571@slbhw0...
Hi,

I want to load contents of a remote HTML file and to display it on the ASP
.NET Web Page. The remote HTML file is not under any virtual folder and
the
content & location may vary for each operations.

How can I do the same?

Thanks,
Anbu

Nov 19 '05 #2
Can I have some example?

"Grant Merwitz" <gr***@workshare.com> wrote in message
news:u7*************@tk2msftngp13.phx.gbl...
You can use your code to Access files on the server or in shares that do not
exist in your virtual directories, regarding your ASPNET system account has
sufficient privalges, or the account IIS is using.
This can also be overcome using impersonation.

To load this file, you can include the file in a place holder on the page,
or write the file out using System.IO

Regards

Grant
"Anbu" <An***********************@alcatel.com> wrote in message
news:1122285437.797571@slbhw0...
Hi,

I want to load contents of a remote HTML file and to display it on the ASP
.NET Web Page. The remote HTML file is not under any virtual folder and
the
content & location may vary for each operations.

How can I do the same?

Thanks,
Anbu


Nov 19 '05 #3
Ok, here goes

I set the security on c:\test to allow everyone full control.
This is not neccesary, just your ASPNET accounts needs these privileges, or
you can impersonate a user on the server with sufficient privileges
CODE:

using System.IO;

// Specify file, instructions, and privelegdes

FileStream file = new FileStream("c:\\test\\test.txt",
FileMode.OpenOrCreate, FileAccess.Write);
// Create a new stream to write to the file

StreamWriter sw = new StreamWriter(file);

// Write a string to the file

sw.Write("Hello file system world!");

// Close StreamWriter

sw.Close();

// Close file

file.Close();

// *** Read from file ***

// Specify file, instructions, and privelegdes

file = new FileStream("c:\\test\\test.txt", FileMode.OpenOrCreate,
FileAccess.Read);

// Create a new stream to read from a file

StreamReader sr = new StreamReader(file);

// Read contents of file into a string

string s = sr.ReadToEnd();

Response.Write(s);

// Close StreamReader

sr.Close();

// Close file

file.Close();

"Anbu" <An***********************@alcatel.com> wrote in message
news:1122288077.300020@slbhw0...
Can I have some example?

"Grant Merwitz" <gr***@workshare.com> wrote in message
news:u7*************@tk2msftngp13.phx.gbl...
You can use your code to Access files on the server or in shares that do
not
exist in your virtual directories, regarding your ASPNET system account
has
sufficient privalges, or the account IIS is using.
This can also be overcome using impersonation.

To load this file, you can include the file in a place holder on the page,
or write the file out using System.IO

Regards

Grant
"Anbu" <An***********************@alcatel.com> wrote in message
news:1122285437.797571@slbhw0...
Hi,

I want to load contents of a remote HTML file and to display it on the
ASP
.NET Web Page. The remote HTML file is not under any virtual folder and
the
content & location may vary for each operations.

How can I do the same?

Thanks,
Anbu


Nov 19 '05 #4
Thanks Grant,

I have no problem in reading the text file, but displaying at the
appropriate place. I read the document using filestream classes.

If I use Response.Write to display the HTML Contents, it prints the contents
on the TOP or BOTTOM of the ASPX page. Whereas, I want to display the
content at a particular place. Because I have many controls placed as header
and footer. Somehow, I solved the problem by using Label and LiteralControl.
Still the content does not look fine. I'm looking for an alternate...

Thanks for your help.
"Grant Merwitz" <gr***@workshare.com> wrote in message
news:#H**************@TK2MSFTNGP09.phx.gbl...
Ok, here goes

I set the security on c:\test to allow everyone full control.
This is not neccesary, just your ASPNET accounts needs these privileges, or
you can impersonate a user on the server with sufficient privileges
CODE:

using System.IO;

// Specify file, instructions, and privelegdes

FileStream file = new FileStream("c:\\test\\test.txt",
FileMode.OpenOrCreate, FileAccess.Write);
// Create a new stream to write to the file

StreamWriter sw = new StreamWriter(file);

// Write a string to the file

sw.Write("Hello file system world!");

// Close StreamWriter

sw.Close();

// Close file

file.Close();

// *** Read from file ***

// Specify file, instructions, and privelegdes

file = new FileStream("c:\\test\\test.txt", FileMode.OpenOrCreate,
FileAccess.Read);

// Create a new stream to read from a file

StreamReader sr = new StreamReader(file);

// Read contents of file into a string

string s = sr.ReadToEnd();

Response.Write(s);

// Close StreamReader

sr.Close();

// Close file

file.Close();

"Anbu" <An***********************@alcatel.com> wrote in message
news:1122288077.300020@slbhw0...
Can I have some example?

"Grant Merwitz" <gr***@workshare.com> wrote in message
news:u7*************@tk2msftngp13.phx.gbl...
You can use your code to Access files on the server or in shares that do
not
exist in your virtual directories, regarding your ASPNET system account
has
sufficient privalges, or the account IIS is using.
This can also be overcome using impersonation.

To load this file, you can include the file in a place holder on the page,
or write the file out using System.IO

Regards

Grant
"Anbu" <An***********************@alcatel.com> wrote in message
news:1122285437.797571@slbhw0...
Hi,

I want to load contents of a remote HTML file and to display it on the
ASP
.NET Web Page. The remote HTML file is not under any virtual folder and
the
content & location may vary for each operations.

How can I do the same?

Thanks,
Anbu



Nov 19 '05 #5
Thanks Grant,

I have no problem in reading the text file, but displaying at the
appropriate place. I read the document using filestream classes.

If I use Response.Write to display the HTML Contents, it prints the contents
on the TOP or BOTTOM of the ASPX page. Whereas, I want to display the
content at a particular place. Because I have many controls placed as header
and footer. Somehow, I solved the problem by using Label and LiteralControl.
Still the content does not look fine. I'm looking for an alternate...

Thanks for your help.
"Grant Merwitz" <gr***@workshare.com> wrote in message
news:#H**************@TK2MSFTNGP09.phx.gbl...
Ok, here goes

I set the security on c:\test to allow everyone full control.
This is not neccesary, just your ASPNET accounts needs these privileges, or
you can impersonate a user on the server with sufficient privileges
CODE:

using System.IO;

// Specify file, instructions, and privelegdes

FileStream file = new FileStream("c:\\test\\test.txt",
FileMode.OpenOrCreate, FileAccess.Write);
// Create a new stream to write to the file

StreamWriter sw = new StreamWriter(file);

// Write a string to the file

sw.Write("Hello file system world!");

// Close StreamWriter

sw.Close();

// Close file

file.Close();

// *** Read from file ***

// Specify file, instructions, and privelegdes

file = new FileStream("c:\\test\\test.txt", FileMode.OpenOrCreate,
FileAccess.Read);

// Create a new stream to read from a file

StreamReader sr = new StreamReader(file);

// Read contents of file into a string

string s = sr.ReadToEnd();

Response.Write(s);

// Close StreamReader

sr.Close();

// Close file

file.Close();

"Anbu" <An***********************@alcatel.com> wrote in message
news:1122288077.300020@slbhw0...
Can I have some example?

"Grant Merwitz" <gr***@workshare.com> wrote in message
news:u7*************@tk2msftngp13.phx.gbl...
You can use your code to Access files on the server or in shares that do
not
exist in your virtual directories, regarding your ASPNET system account
has
sufficient privalges, or the account IIS is using.
This can also be overcome using impersonation.

To load this file, you can include the file in a place holder on the page,
or write the file out using System.IO

Regards

Grant
"Anbu" <An***********************@alcatel.com> wrote in message
news:1122285437.797571@slbhw0...
Hi,

I want to load contents of a remote HTML file and to display it on the
ASP
.NET Web Page. The remote HTML file is not under any virtual folder and
the
content & location may vary for each operations.

How can I do the same?

Thanks,
Anbu



Nov 19 '05 #6
Thanks Grant,

I have no problem in reading the text file, but displaying at the
appropriate place. I read the document using filestream classes.

If I use Response.Write to display the HTML Contents, it prints the contents
on the TOP or BOTTOM of the ASPX page. Whereas, I want to display the
content at a particular place. Because I have many controls placed as header
and footer. Somehow, I solved the problem by using Label and LiteralControl.
Still the content does not look fine. I'm looking for an alternate...

Thanks for your help.
"Grant Merwitz" <gr***@workshare.com> wrote in message
news:#H**************@TK2MSFTNGP09.phx.gbl...
Ok, here goes

I set the security on c:\test to allow everyone full control.
This is not neccesary, just your ASPNET accounts needs these privileges, or
you can impersonate a user on the server with sufficient privileges
CODE:

using System.IO;

// Specify file, instructions, and privelegdes

FileStream file = new FileStream("c:\\test\\test.txt",
FileMode.OpenOrCreate, FileAccess.Write);
// Create a new stream to write to the file

StreamWriter sw = new StreamWriter(file);

// Write a string to the file

sw.Write("Hello file system world!");

// Close StreamWriter

sw.Close();

// Close file

file.Close();

// *** Read from file ***

// Specify file, instructions, and privelegdes

file = new FileStream("c:\\test\\test.txt", FileMode.OpenOrCreate,
FileAccess.Read);

// Create a new stream to read from a file

StreamReader sr = new StreamReader(file);

// Read contents of file into a string

string s = sr.ReadToEnd();

Response.Write(s);

// Close StreamReader

sr.Close();

// Close file

file.Close();

"Anbu" <An***********************@alcatel.com> wrote in message
news:1122288077.300020@slbhw0...
Can I have some example?

"Grant Merwitz" <gr***@workshare.com> wrote in message
news:u7*************@tk2msftngp13.phx.gbl...
You can use your code to Access files on the server or in shares that do
not
exist in your virtual directories, regarding your ASPNET system account
has
sufficient privalges, or the account IIS is using.
This can also be overcome using impersonation.

To load this file, you can include the file in a place holder on the page,
or write the file out using System.IO

Regards

Grant
"Anbu" <An***********************@alcatel.com> wrote in message
news:1122285437.797571@slbhw0...
Hi,

I want to load contents of a remote HTML file and to display it on the
ASP
.NET Web Page. The remote HTML file is not under any virtual folder and
the
content & location may vary for each operations.

How can I do the same?

Thanks,
Anbu




Nov 19 '05 #7
Thanks Grant,

I have no problem in reading the text file, but displaying at the
appropriate place. I read the document using filestream classes.

If I use Response.Write to display the HTML Contents, it prints the contents
on the TOP or BOTTOM of the ASPX page. Whereas, I want to display the
content at a particular place. Because I have many controls placed as header
and footer. Somehow, I solved the problem by using Label and LiteralControl.
Still the content does not look fine. I'm looking for an alternate...

Thanks for your help.
"Grant Merwitz" <gr***@workshare.com> wrote in message
news:#H**************@TK2MSFTNGP09.phx.gbl...
Ok, here goes

I set the security on c:\test to allow everyone full control.
This is not neccesary, just your ASPNET accounts needs these privileges, or
you can impersonate a user on the server with sufficient privileges
CODE:

using System.IO;

// Specify file, instructions, and privelegdes

FileStream file = new FileStream("c:\\test\\test.txt",
FileMode.OpenOrCreate, FileAccess.Write);
// Create a new stream to write to the file

StreamWriter sw = new StreamWriter(file);

// Write a string to the file

sw.Write("Hello file system world!");

// Close StreamWriter

sw.Close();

// Close file

file.Close();

// *** Read from file ***

// Specify file, instructions, and privelegdes

file = new FileStream("c:\\test\\test.txt", FileMode.OpenOrCreate,
FileAccess.Read);

// Create a new stream to read from a file

StreamReader sr = new StreamReader(file);

// Read contents of file into a string

string s = sr.ReadToEnd();

Response.Write(s);

// Close StreamReader

sr.Close();

// Close file

file.Close();

"Anbu" <An***********************@alcatel.com> wrote in message
news:1122288077.300020@slbhw0...
Can I have some example?

"Grant Merwitz" <gr***@workshare.com> wrote in message
news:u7*************@tk2msftngp13.phx.gbl...
You can use your code to Access files on the server or in shares that do
not
exist in your virtual directories, regarding your ASPNET system account
has
sufficient privalges, or the account IIS is using.
This can also be overcome using impersonation.

To load this file, you can include the file in a place holder on the page,
or write the file out using System.IO

Regards

Grant
"Anbu" <An***********************@alcatel.com> wrote in message
news:1122285437.797571@slbhw0...
Hi,

I want to load contents of a remote HTML file and to display it on the
ASP
.NET Web Page. The remote HTML file is not under any virtual folder and
the
content & location may vary for each operations.

How can I do the same?

Thanks,
Anbu




Nov 19 '05 #8

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

Similar topics

0
by: Brent | last post by:
I maintain a Sql Server database application whose forms are compiled in a .dll and kept in a remote web folder. The main .exe looks to the web folder to see if this .dll exists. If so, then it...
4
by: Razzbar | last post by:
I need to be able to conditionally load a remote script, using the "<script src=..." syntax. Or some other way. I've seen people writing about using the document.write method, but it's not working...
6
by: Pete Davis | last post by:
I'm confused about what precisely the limitations are on loading plugins in separate app domains. In all my previous apps that supported plugins, I've loaded them into the same domain as the app,...
0
by: Jeff | last post by:
Hello, I've run into a problem with my asp.net application and would like to know whether the error is likely with my remote host. The problem is an unhandled exception, and the exception...
2
by: Jeff | last post by:
Hello, I've run into a problem with my asp.net application and would like to know whether the error is likely with my remote host. The problem is an unhandled exception, and the exception...
1
by: Anbu | last post by:
Hi, I want to load contents of a remote HTML file and to display it on the ASP ..NET Web Page. The remote HTML file is not under any virtual folder and the content & location may vary for each...
2
by: hbchai | last post by:
I'm adapting the ajax-like asynchronous request pattern mentioned in this article: http://www.xml.com/pub/a/2005/11/09/fixing-ajax-xmlhttprequest-considered-harmful.html?page=2 for my Sudoku...
0
by: the_kiddie98 | last post by:
Hi, I have a C# project which handles web requests to a server. On my local machine, I can usually attach to aspnet_wp once and debug file (hitting breakpoints), however if I stop and want to...
6
by: Gouri.Mahajan7 | last post by:
Hello, When I press the button on the web page I am loading the user control on the web page. This user control is invoking some methods of the web service. The control on the web page is loaded...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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,...

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.