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 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
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
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
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
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
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
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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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,...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
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,...
| |