473,327 Members | 1,920 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Internet logging using c# & perl cgi script

84
Hi Guys,
Can someone please help me with this wierd issue?

I have a c# code below
Expand|Select|Wrap|Line Numbers
  1. string lcUrl = "myscript.cgi";
  2.  
  3.  
  4.  
  5.             // *** Establish the request
  6.  
  7.             HttpWebRequest loHttp =
  8.                  (HttpWebRequest)WebRequest.Create(lcUrl);
  9.  
  10.  
  11.  
  12.             // *** Set properties
  13.  
  14.             loHttp.Timeout = 10000;     // 10 secs
  15.  
  16.             loHttp.UserAgent = "Code Sample Web Client";
  17.             //loHttp.
  18.  
  19.             loHttp.Method = "GET";
  20.  
  21.  
  22.  
  23.             // *** Retrieve request info headers
  24.  
  25.             HttpWebResponse loWebResponse = (HttpWebResponse)loHttp.GetResponse();
  26.  
  27.  
  28.  
  29.             Encoding enc = Encoding.GetEncoding(1252);  // Windows default Code Page
  30.  
  31.  
  32.  
  33.             StreamReader loResponseStream = new StreamReader(loWebResponse.GetResponseStream(), enc);
  34.  
  35.  
  36.  
  37.             string lcHtml = loResponseStream.ReadToEnd();
  38.  
  39.  
  40.  
  41.             loWebResponse.Close();
  42.             loResponseStream.Close();
  43.  
This just goes to a perl cgi script white writes a log on the server. This script has also been attached.

Everything works fine from internet explorer or mozilla, but when i use the above code to fetch the data from the script it writes the same log entry twice which i believe is something to do with above.

Can someone please help???


Thanks in advance
Attached Files
File Type: zip myscript.zip (978 Bytes, 94 views)
Jun 11 '09 #1
0 1608

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Ravi Shankar | last post by:
Hi all, I have an enterprise application. I am using Apache Log4J for the logging purposes. WHen a request is received by the application, it goes throug servlets and many classes, and the...
0
by: Herman Chan | last post by:
Hi: I am facing this problem lately and wonders if anyone in here has any suggestions. I have this 2-tier web app that is written in perl. Perl script is both install in the client computer...
0
by: Antwerp | last post by:
Hi, I'm trying to create a perl script that will log into a website (the login form uses POST), navigate to several pages, and append the (html) content parsed from those pages to a seperate log...
23
by: Rotem | last post by:
Hi, while working on something in my current project I have made several improvements to the logging package in Python, two of them are worth mentioning: 1. addition of a logging record field...
3
by: Chris Smith | last post by:
Hola, pythonisas: The documentation for the logging module is good, but a bit obscure. In particular, there seems to be a lot of action at a distance. The fact that getLogger() can actually be a...
0
by: supern | last post by:
this is my perl script saved as login.pl #!c:/perl/bin/perl.exe $basedir="c:/program files/apache software foundation/apache2.2/cgi-bin"; $datafile="regstr.txt"; $name=$in{'login'};...
3
by: jonathan184 | last post by:
The code seems to be working fine for some records but I am thinking it is finding some other records with special characters and so on. I am looking for a way to insert the xml string with escaping...
2
by: swethak | last post by:
Hi, I am getting the problem the problem with google map in Internet Explorer. This map worked fine in mozilla . When i opened the same map in Internet Explorer i am getting the error...
4
by: alag20 | last post by:
Hi Guys, Sorry for duplicate posting as this Question refers to both c# and perl cgi script on the net, so please help. Here is the original post...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
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...
0
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...
1
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)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.