Click here to Skip to main content
15,890,579 members
Home / Discussions / C#
   

C#

 
GeneralRe: string versus String ! Pin
PIEBALDconsult14-Aug-09 10:51
mvePIEBALDconsult14-Aug-09 10:51 
AnswerRe: string versus String ! Pin
_Q12_14-Aug-09 5:44
_Q12_14-Aug-09 5:44 
AnswerRe: string versus String ! Pin
murktinez14-Aug-09 8:06
murktinez14-Aug-09 8:06 
QuestionHow can i detect if a path is valid. Pin
Saksida Bojan14-Aug-09 3:46
Saksida Bojan14-Aug-09 3:46 
AnswerRe: How can i detect if a path is valid. Pin
picazo14-Aug-09 4:03
picazo14-Aug-09 4:03 
AnswerRe: How can i detect if a path is valid. Pin
Luc Pattyn14-Aug-09 4:08
sitebuilderLuc Pattyn14-Aug-09 4:08 
GeneralRe: How can i detect if a path is valid. Pin
Saksida Bojan14-Aug-09 5:05
Saksida Bojan14-Aug-09 5:05 
QuestionC# and JavaScript. [modified] Pin
Evgeni5714-Aug-09 3:34
Evgeni5714-Aug-09 3:34 
Hi all,

Sometime ago I wrote some automation tool to get content of some site.
Everything worked fine untill one day...

My C# code creted url string and made http hit. I used HttpRequest and Response.
Request looked like http://somesite.con/param1=a&param2=b&param3=c
Now, there was a change in the site and it always makes redirect to the url that looks like:
http://somesite.con/param1=a&param2=b&param3=c&rnd=AbCdEfG1.
With the fiddler I saw that actially web browser makes 2 hits:
1. The old one.
2. The new one.
Now the response of the first hit contains some JS code that generates this random code (AbCdEfG1), concatinates it to the main url and makes redirect.

As far as I understand I need to execute this JS from C#. It's may be done in the several ways and seems not too complex to do.
But then I need to or:
a. get back this random value from JS.
b. allow to JS to make redirection, but need to get back the response.
I prefer the b. because code that generates this random value always different (code generation or something).

The code of JS is something like that:
html>
    <head>
        <title></title>
    </head>


    <script type="text/javascript">
        function redirect()
        {
            var redirectLoc = window.location.href;
            if (redirectLoc.indexOf ('?')>-1) redirectLoc +="&"; else redirectLoc+="?";
            redirectLoc = redirectLoc.replace (/rnd=[0-9a-zA-Z]+&/,"");
            window.location = redirectLoc+'rnd='+f1();
        }
    </script>
<script type="text/javascript">
					function sbbpWvum()
					{
						nCc = typeof "zCa";
						return String.fromCharCode(nCc.charCodeAt(4)^37);
					}
function f1()
					{
						return sbbpWvum();
					}

Any one can help with this isue?
Thanks.

modified on Friday, August 14, 2009 10:04 AM

AnswerRe: C# and JavaScript. Pin
Evgeni5717-Aug-09 1:41
Evgeni5717-Aug-09 1:41 
QuestionLogging Pin
Saksida Bojan14-Aug-09 3:02
Saksida Bojan14-Aug-09 3:02 
AnswerRe: Logging Pin
0x3c014-Aug-09 3:20
0x3c014-Aug-09 3:20 
QuestionAccess OleDb on x64 Pin
V.14-Aug-09 2:43
professionalV.14-Aug-09 2:43 
AnswerRe: Access OleDb on x64 Pin
Hristo-Bojilov14-Aug-09 22:20
Hristo-Bojilov14-Aug-09 22:20 
GeneralRe: Access OleDb on x64 Pin
V.17-Aug-09 23:43
professionalV.17-Aug-09 23:43 
Questionlog4net doesn't log in myProcess.OutputDataReceived Pin
buchstaben14-Aug-09 1:53
buchstaben14-Aug-09 1:53 
QuestionSqlDataReader-Ouput Parameter And SqlConnection Pin
Nagaraj Muthuchamy14-Aug-09 1:12
professionalNagaraj Muthuchamy14-Aug-09 1:12 
AnswerRe: SqlDataReader-Ouput Parameter And SqlConnection Pin
Ashfield14-Aug-09 1:17
Ashfield14-Aug-09 1:17 
GeneralRe: SqlDataReader-Ouput Parameter And SqlConnection Pin
Nagaraj Muthuchamy14-Aug-09 1:25
professionalNagaraj Muthuchamy14-Aug-09 1:25 
GeneralRe: SqlDataReader-Ouput Parameter And SqlConnection Pin
Coding C#14-Aug-09 1:29
Coding C#14-Aug-09 1:29 
GeneralRe: SqlDataReader-Ouput Parameter And SqlConnection Pin
Ashfield14-Aug-09 2:57
Ashfield14-Aug-09 2:57 
GeneralRe: SqlDataReader-Ouput Parameter And SqlConnection Pin
Pete O'Hanlon14-Aug-09 3:01
mvePete O'Hanlon14-Aug-09 3:01 
GeneralRe: SqlDataReader-Ouput Parameter And SqlConnection Pin
Ashfield14-Aug-09 5:05
Ashfield14-Aug-09 5:05 
QuestionDisabling a button on one form from another. Pin
False Chicken14-Aug-09 0:28
False Chicken14-Aug-09 0:28 
AnswerRe: Disabling a button on one form from another. Pin
DaveyM6914-Aug-09 0:53
professionalDaveyM6914-Aug-09 0:53 
AnswerRe: Disabling a button on one form from another. Pin
DaveyM6914-Aug-09 1:00
professionalDaveyM6914-Aug-09 1:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.