CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > migration_to_asp.net.migrating_from_php_to_asp.net.php_to_asp.net_migration_assistant_alpha Tags:
Item Type: NewsGroup Date Entered: 7/27/2007 4:36:17 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 22 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
fazal.shaikh
Asp.Net User
Help in converting the php code7/27/2007 4:36:17 AM

0/0

Hello all,

I am having a problem in converting the following code  into asp.net.

$lines = file("http://someIPAddress/login/chkauth.asp?login=$username&pwd=$password");
$filestr="";
foreach ($lines as $line_num => $line) {
  $filestr=$filestr.htmlspecialchars($line);
}
$loginverify=0;
$loginverify=preg_match("/Invalid/",$filestr);
//preg_match is similar to the substr or instr function of string object.
//above LOC is finding "Invalid" within $filestr variable.

the above code is used for using the output generated by the page chkauth.asp.

I was able to make out the last method i.e. preg_match(). but help me with the file() method.

thanks

 Fazal
 

somnathmali
Asp.Net User
Re: Help in converting the php code7/27/2007 6:00:45 AM

0/0

Use WebRequest Class...

using System.IO;
using System.Net;

  WebRequest request = WebRequest.Create ("http://.... ");

for details please check http://msdn2.microsoft.com/en-us/library/debx8sh9.aspx

 


Somnath Mali
.NET Developer , Pune INDIA.


http://www.fotosplatter.com



http://somnath-ms-dot-net.blogspot.com


Please Mark As Answer If my reply helped you.

fazal.shaikh
Asp.Net User
Re: Help in converting the php code7/27/2007 9:31:42 AM

0/0

thanks somnath,

but your link to the page helped me in urls without  querystrings. If I am passing any querystring parameter, then it gives an error saying "Cannot send a content-body with this verb-type." But the other link I got from somewhere else, helped me. the code is.

                strURL = "http://someIPAddress/login/chkauth.asp?login=userName&pwd=password
                Dim objClient As New WebClient
                objLines = objClient.OpenRead(strURL)
                Dim objStreamReader As New StreamReader(objLines)
                strLines = objStreamReader.ReadToEnd

http://msdn2.microsoft.com/en-us/library/bay1b5dh.aspx

 

Thanks a lot. 

Fazal... 

fazal.shaikh
Asp.Net User
Re: Help in converting the php code8/29/2007 6:05:46 AM

0/0

Hello all,

After implementing the previous code that I had used, I am facing a typical problem.

On the VS.NET I am able to run the application successfully.

When I run it on the Local server (localhost) it is giving me the following error

"A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"

and when I am running it on the same machine but with IP address of the system or from the client machine, it is giving me same error.

can anyone help me out of this...

 

Thanks in Advance... 

4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
PHP5 and MySQL Bible Authors: Tim Converse, Joyce Park, Clark Morgan, Pages: 1042, Published: 2004
Programming Multiplayer Games Authors: Andrew Mulholland, Teijo Hakala, Pages: 500, Published: 2004
Web Database Applications with PHP and MySQL: Building Effective Database-Driven Web Sites Authors: Hugh E. Williams, David Lane, David John Lane, Pages: 796, Published: 2004
The Essential Guide to Dreamweaver CS3 with CSS, Ajax, and PHP Authors: David Powers, Pages: 784, Published: 2007
Beginning PHP and Oracle: From Novice to Professional Authors: W. Jason Gilmore, Bob Bryla, Pages: 763, Published: 2007
Learning PHP and MySQL: A Step-by-Step Guide to Creating Dynamic, Database-Driven Web Sites Authors: Michele E. Davis, Jon Phillips, Pages: 411, Published: 2007
PHP Object-Oriented Solutions Authors: David Powers, Pages: 392, Published: 2008
XML and PHP Authors: Vikram Vaswani, Pages: 358, Published: 2002
Php Functions Essential Reference: Essential Reference Authors: Zak Greant, Landon Bradshaw, Torben Wilson, Graeme Merrall, Brett Michlitsch, Pages: 768, Published: 2001
Essential PHP Fast: Building Dynamic Web Sites with MySQL Authors: Stobart Simon, Simon Stobart, Pages: 249, Published: 2002

Web:
Help in converting the php code - ASP.NET Forums Help in converting the php code. Last post 08-29-2007 2:05 AM by fazal.shaikh. 3 replies. Sort Posts:. Oldest to newest, Newest to oldest ...
Help converting short php script to ASP - ASP Help converting short php script to ASP. Get answers to your questions in our ASP forum.
AS - Help converting simple PHP form to flash - Ultrashock Forums AS - Help converting simple PHP form to flash Old 2008-02-22 ... Any help would be appreciated, here is the form. PHP Code: ...
converting perl script to php help!! - ProgrammingTalk converting perl script to php help!! Perl. ... Help with my largest perl script. Grabbing data from a file. ...
Need help converting JSP code to PHP (was: convert) - Dev Shed Need help converting JSP code to PHP (was: convert)- Project Help Wanted. Visit Dev Shed to discuss Need help converting JSP code to PHP (was: convert)
help converting php code to c#? - Usenet Forums hello all i don't know if this is the right place to put this but i need to convert the following code to c# - asp.net any help will be ...
Help in converting Code in PHP for Web Service Security | WSO2 ... Oct 4, 2007 ... Hello we are executing an application for web service security where we have a code in C# and using WSF/PHP we are trying to make it in PHP.
Need help converting PHP/BASH script to pure BASH - Ubuntu Forums Need help converting PHP/BASH script to pure BASH Programming Talk.
PHP - Need Help With Converting FLV To Mp3 With PHP | DreamInCode.net PHP - Need Help With Converting FLV To Mp3 With PHP. Get help with this and thousands of other PHP and web development topics at ...
Convert PHP4 to PHP5 : Help for converting PHP 4 to PHP 5 The process of converting a website from PHP4 to PHP5 is quite simple task for a php developer, but for the end users who are not able to code well enough ...

Videos:
Watch Video on Converting to Scientific Notation - Math Help Access full lesson containing this video at: http://www.yourteacher.com/prealgebra/converttoscientificnotation.php Students learn to convert a number...
Setup Hlss - Help Video!!! For all those noobs , that needs help with hlss.... Here's the help... FOR CONVERTING Your Sounds U Need This Tool : dBpowerAMP Music Converter 11.5...
FORSAKEN [Anime Boston 2007 Best Action Video Nominee] IMPORTANT: The sync is off by about half a second when viewing on YouTube. I don't upload WMV formated videos anymore for this reason, please downloa...
Watch Video on Converting to Scientific Notation - Math Help Access full lesson containing this video at: http://www.yourteacher.com/prealgebra/converttoscientificnotation.php Students learn to convert a number...
Watch Video on Fraction to Decimal - Math Help Access full lesson containing this video at: http://www.yourteacher.com/prealgebra/fractiontodecimal.php Students learn to convert fractions to decim...
Watch Video on Decimal to Fraction - Math Help Access full lesson containing this video at: http://www.yourteacher.com/prealgebra/convertdecimaltofraction.php Students use the place value chart to...
Watch Video on Fraction to Percent - Math Help Access full lesson containing this video at: http://www.yourteacher.com/prealgebra/percenttofraction.php Students learn to write percents as fraction...
Watch Video on Decimal to Percent - Math Help Access full lesson containing this video at: http://www.yourteacher.com/prealgebra/percenttodecimal.php Students learn to write percents as decimals ...
(How To Generate Real Estate Leads) Long Lost Techniques! http://www.LureProspecting.com Shea Korte how to generate real estate leads (how to generate real estate leads) "how to generate real estate leads" h...
Watch Video on Percent to Decimal - Math Help Access full lesson containing this video at: http://www.yourteacher.com/prealgebra/percenttodecimal.php Students learn to write percents as decimals ...




Search This Site:










error regarding web.config file while using forms authentication on a server.

access dotnetnuke from remote client

dnn 3.0.13b (alex edition)

dynamic treeview : showing updating... while populating nodes

difference in md5 between 1.1 and 2.0?

vwd - webserver

installation error- newbie

access membership provider with its db and the application db ?!

anything that automatically creates forms for dnn, like ironspeed?

skins and parsing problem...

vb code ok in vb05 express but not vwd05 express

persistant cookie not persisting?

page.isvalid

setting a theme at runtime

manipulating value of an item before its displayed in data repeater

password complexity/strength

product catalog module

css not working in firefox

.net v1.1 sp1 and .net 2.0 beta 2

diffrence between 2.1.2 dnntree and 3.0.8 dnntree ?

sharing events database entries from different pages

read data from a csv file and insert it in a sql server databse table

hyperlinks from hell...

problems with wingdings in dnn....help!

html validation can't be disabled

masterpages and inheritance

skin styling problem

caching question

bug: dnn 3.0.9 and foreign "umlauts" in page name

design time and onpaint

 
All Times Are GMT