This topic has been archived. It cannot be replied.
-
工作学习 / 学科技术讨论 / holdon,打发打发时间,关于只接受browser提交的login,我自创个方法(可能有雷同):HttpWebRequest应该没有运行JavaScript的能力,这样,在onload中用ajax从server端获得一个数字签名,提交(submit)时在server端验证签名。点评一下。
-readonly(ReadOnly);
2008-6-11
(#4496043@0)
-
HttpWebRequest can't run javascipt, ture. but you can parse the response, find out what need to be run, and run it as C#. e.g. start another httpwebrequest as ajax call.As long as you "Know" the web site, you can access it by browser, check the returned html source, see what's inside it , and programing your C# application to do same thing. Anything javascript can do, C# should also be able to do it.
Right now, the only pratical solution I saw is embed a image and ask the user to type in what's inside the image.
-holdon(again);
2008-6-11
{362}
(#4496146@0)
-
Just returned from a meeting. Ajax can call a server side function. I don't think httpwebrequest can call a public function belonged to a web page. BTW, nothing is impossible. but I think it's enough for most of web sites.
-readonly(ReadOnly);
2008-6-11
(#4496469@0)
-
You don't get it. What is a Ajax call? it's a http request from Javascript. on server side, it's a http request. Again, there is no way server can tell if this call is from a XMLObject, or a WebRequest.
-holdon(again);
2008-6-11
(#4496592@0)
-
Technically you're right. But in .NET framework 3.5, there are lots of preimplemented features (both on server side and client side) for ajax. You need dig out httprequest pattern of ajax so that you can use httpwebrequest to mimic ajax call.
-readonly(ReadOnly);
2008-6-11
(#4496663@0)
-
You are so into .NET, AJAX and HttpWebRequest those stuff. All they do are just sending plain text to remote server. That's it, nothing more. HTTP hasn't been changed for years.
-liquid(豆泡松果 之 松果豆泡);
2008-6-11
(#4496932@0)
-
yeah, right. Like google map using httpwebrequest. but I just wonder how many web developer can develope google map?
-readonly(ReadOnly);
2008-6-11
(#4496958@0)
-
some .Net developers are a little bit narrow minded. carletonwong is asking how to download ssl site files by .Net client; he didn't say one word if the server is .Net. lots of .Net developers assume it's .Net server.
-holdon(again);
2008-6-12
{693}
(#4497476@0)
-
呵呵,.NET不是天外来客,任何.NET能实现的事情,别的环境也都能实现,即使不叫Form authentication,也是用cookie来放security token的。至于AJAX,在100%javascript上讨论也是吹吹牛而已,就象有人说可以用notepad开发网站。.NET也好,Java也好,或者别的环境,如果没有支持Ajax的模块,要开发Ajax程序无异是相当地困难。
难度不在"http client to call the server side function"。
难度在
1:多次call必须call在同一个session。(这个其实也不难)。
2:加密的key藏在某个信息中。(这个就比较烦)
3: 当然还得写parse httpresponse的代码。
-readonly(ReadOnly);
2008-6-12
{393}
(#4497593@0)
-
Acturally building a ajax module is not that difficult.
-holdon(again);
2008-6-12
{687}
(#4497682@0)
-
Ajax="use javascript to send xml string to http server". So you can simply use ASP and no-third party javascript to write a so called AJAX server. IE and FF both provides native xmlhttp support.
-liquid(豆泡松果 之 松果豆泡);
2008-6-12
(#4497765@0)
-
the request is http, not necessarily xml string. the response can also be anything, but because javascipt can understand xml, most ajax library use xml.
-holdon(again);
2008-6-12
(#4497811@0)