473,796 Members | 2,720 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Internet logging using c# & perl cgi script

84 New Member
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, 96 views)
Jun 11 '09 #1
0 1638

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

Similar topics

5
7999
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 necessary details are logged to files, which has autorate option. I mean when certain file exceeds the size, automatically another file is generated for a maximum of 10 files and then again starts from the first. So far is so good. Now assume that...
0
1458
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 and server computer. The scripts located in client computer talks to the script in the server computer and send HTTP request and response back and forth. Now, we need a logging procedure in place for this system. I have the generally
0
11565
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 file. I'm not very familiar with this aspect of perl, and have been having some trouble in the POSTing of the form data, while using cookies to log in. Visting the site automatically redirects you to a login page. Once you fill out the login...
23
2227
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 %(function)s, which results in the name of the entity which logged the record. My version even deduces the class name in the case which the logger is a bound method, and assuming the name of the "self" variable is indeed "self".
3
2472
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 call to Logger.__init__(), which is mentioned in para 6.29.1, also bears stressing on 6.29. I grasp _why_ you'd implement it that way, but I may not be the only coder who feels queasy with the word 'get' being used both to fetch an instance and...
0
1652
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'}; $passwd=$in{'passwd'}; open(FH1,"+>>regstr.txt"); @input=<FH1>; print(@input); @input=($login,$password);
3
3222
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 a bunch of chars This is the message i got DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your M ySQL server version for the right syntax to use near 'd to test@email.com...
2
3157
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 message as in alert box as " Internet Explorer cannot open the Internet site http://google.citycarrentals.com.au/viewalllocations.php . Operation aborted". It is working in Mozilla . Here i mentioned my code . I am facing this problem several...
4
3080
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 http://bytes.com/topic/c-sharp/answers/870412-internet-logging-using-c-perl-cgi-script#post3493381 which contains the perl cgi script and c# code i am using. Please help - any help will be highly appreciated.
0
9524
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10217
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10168
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9047
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5568
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.