|
We have an ASP.NET forum, but you would not use ASP.NET to do this, because that's plainl impossible, you don't want to run a server that generates HTML ( ASP.NET ), you want to run a client app that requests pages and stores their content ( this would be a winforms app )
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
You could try this as a starting point:
<br />
public static string GetPageFromUrl(string strUrl)<br />
{<br />
string strReturn = string.Empty;<br />
<br />
WebRequest webRequest;<br />
WebResponse webResponse = null;<br />
<br />
try<br />
{<br />
webRequest = WebRequest.Create(strUrl);<br />
#if(DEBUG)<br />
webRequest.Proxy = WebRequest.DefaultWebProxy;<br />
webRequest.Proxy.Credentials = CredentialCache.DefaultCredentials;<br />
#endif<br />
webRequest.Timeout = 10000;<br />
webResponse = webRequest.GetResponse();<br />
Stream streamReceive = webResponse.GetResponseStream();<br />
Encoding encoding = Encoding.GetEncoding("utf-8");<br />
StreamReader streamReader = new StreamReader(streamReceive, encoding);<br />
strReturn = streamReader.ReadToEnd();<br />
streamReader.Close();<br />
}<br />
catch (Exception exception)<br />
{<br />
Console.Write(exception.Message);<br />
}<br />
finally<br />
{<br />
if (webResponse != null)<br />
{<br />
webResponse.Close();<br />
}<br />
}<br />
<br />
return strReturn;<br />
}<br />
The code above is somewhat simplistic; however if you pass it a valid url it will attempt to return the text of the requested page. I leave it to you to implement some more appropriate exception handling, etc.
|
|
|
|
|
Thanx a million, its nice to finally get a response on a forum without someone trying to give me a list of reasons why i should not do this, assuming that i wanted to do it for a reason they thought up.
Thanx again this code works killer
|
|
|
|
|
Hi All,
Suppose I have a page that allows users to download a file. Before the file download, I want to perform custom processing on the file. For example, I want to unpack it from the zip, perform the custom processing, and then pack it back up before the download.
I believe an ISAPI extension is the proper technology. However, is this feasible? For example, is it possible [desired] to block a thread in the server process until my extension has processed the file?
Jeff
|
|
|
|
|
It would be much simpler to use an ashx "page" or create an HttpModule than writing an ISAPI extension. Your page would then just need to provide a link that would point to the resource (the ashx page or the actual zip file if you're using an HttpModule). Doing it this way means you're not coupling the custom processing on the zip file with the actual page.
The answer to your second question depends on the amount of time and resources (CPU memory) required to process the zip file (decompress/manipulate/compress) verses the amount of traffic on your site. You can only answer this by doing some testing and observing the server's performance (perfmon utility) when you are processing the zip file. If you determine you need to isolate the process from the rest of your web application, you could create a separte web site on your server that uses either your ashx file or httpmodule and place that application in a separate app pool. If you have the resources, you could even place it on a separate web server. Because your page is just using a link to point to the resource you could place your process anywhere and isolate it.
Mark's blog: developMENTALmadness.blogspot.com
Funniest variable name:
lLongDong - spotted in legacy code, was used to determine how long a beep should be. - Dave Bacher
|
|
|
|
|
At the company I work for we have a web development standard that says all page formatting shall be handled by the HTML of the page and all styling shall be handled by a CSS file. Our standards fail to define what is formatting and what is styling. I assumed styling to be things like color, font face, font size, background images, etc. You know, the "pretty" stuff. I consider formatting to be organization of the data (lists, tables, paragraphs, etc). Recently one of my projects was handed back to me with notes saying the HTML contained styling elements. More specifically, the HTML line break element <br /> is a styling element and not allowed in HTML. I don't agree with this, especially since every web app we have has line breaks in the HTML code, so I can cite precedence. My boss won't listen to my objections so I need some personal vindication. What does everyone think, is the line break a styling element, or a formatting element?
"How come you can't taste your tongue?" - Jon Arbuckle
|
|
|
|
|
If it's used to insert a linebreak in text somewhere, then i say it's perfectly appropriate.
If you're using, say, in lieu of a vertical margin somewhere, then yeah, that sucks.
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
How do you replace <br /> using CSS anyway? If your boss has an answer, I would love to hear that.
I guess you will end up replacing <br /> with <p> or <div> -- they are also HTML elements.
I think that taking so much time on whether <br /> is appropriate in HTML is utterly silly.
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Basically what he was looking for was to wrap everything in separate div elements and relatively position them. I don't see the point. I understand wrapping related content (like a menu or a panel) in a div, but not in this case. What he was complaining about was we had a label like "Notes", then a break and a text area for the notes to be entered, then a break, then the save button. He says each item should be wrapped in a div so they can be all be left aligned together. Poppycock, I say.
"How come you can't taste your tongue?" - Jon Arbuckle
|
|
|
|
|
I am in a search for a non open source alternative to Selenium (openqa.org). Selenium is a Web Automation tool to test a web application. So far, I have only found iMacros but I still need something else to test with Opera and Safari. Any ideas?
|
|
|
|
|
I am currently, for fun(?), parsing a Macs Safari bookmark plist file with Perl, using XML::Simple, and spitting out JavaScript for a CSS enabled drop-down menu system. Phew, what a mouthful!
Anyway, I am having a (Perl) parsing problem; shall I submit the problem details here?
Thanks,
David Green
Interested in answers.
|
|
|
|
|
You can try. There's actually a specific XML forum, but not one for Perl, so this is probably as good as anything.
Who knows? There may be a closet Perl user around.
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
Erm, OK; can you recommend another site/forum ?
Interested in answers.
|
|
|
|
|
PerlMonks[^]?
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
mrdgreen wrote: can you recommend another site/forum ?
Try here.[^]
Good luck, you're going to need it.
led mike
|
|
|
|
|
Why do you say that?
Interested in answers.
|
|
|
|
|
Hi All,
I already post my question in this fourm but I did't get answer of my question. I requested all of you, Please find some time to reply my query.
I have a application which is working good with IE, but not working fine with Opera, Mozila Firefox and Safari. What I need to do, so that my application should also start working with Opera, Mozila and safari. In some pages I am using VB script, Do i need to relace VB script with some JavaScript? Please suggest.
Thanks,
RK
|
|
|
|
|
Hard to believe this was not answered before, it's pretty simple.
You seem to already know the answer. Yes, VBScript is only supported by IE.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks Christian for reply.
Ya I know VBscript is only supported by IE, Then what is the replacement of VBscript so that the application should run with all the browsers. Please suggest.
Thanks,
RK
|
|
|
|
|
Yeah Dude !
Javascript is the ultimate approach to deal with client side events... Go For It...
there are pretty much articles available on NET relating different issues/solutions for javacsript
Ashish Sehajpal
|
|
|
|
|
You said it in your question - it's javascript.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Just a tip, this is a very broad issue. Cross browser functionality is a major web design area and takes lots of study and experience to handle correctly. Asking a broad questions like "how do i make it work" will not generate answers. Please try to be more specific questions in future and use google to help yourself get a base knowledge.
Brad
Australian
The PHP MVP
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
Hi,
Hello friend,
I am an ASP.Net progrmmer i am interested to study JSON..can anybody suggest me a good tutorials for JSON...or else give me a sample code for JSON..help me
alex.
|
|
|
|
|
JSON is pretty straightforward, a google should give you articles with all the info you could hope to need.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Ya i got a vague idea..can u tell me the chances for an asp.net programmer in australia....just for curiosity i asked this..
|
|
|
|