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 2338
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: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
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...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
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...
|
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)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
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....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
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...
| |