• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 929
  • Last Modified:

Convert PHP code to Asp.net with C# Code

I need equivalent code in asp.net with c# which posted in php code.
<?
$data = $GLOBALS['HTTP_RAW_POST_DATA'];
$itemid = "test";

$fp =
fopen("/home/cxu/Dev/SharewareEmart/deploy/sites/1/htdocs/examples/result."
. $itemid . "xml", "w");
fwrite($fp, $data);
fclose($fp);
?>

Open in new window

0
Dhanasekaran Sengodan
Asked:
Dhanasekaran Sengodan
1 Solution
 
StealthyDevCommented:
Hi, use the below code.

use the include:

using System.IO;


Regards.

string data = "Something from global variable";
string itemid = "test";
StreamWriter sw = new StreamWriter("d:/examples/result." + itemid + ".xml");
sw.Write(data);
sw.Close();

Open in new window

0
 
Dhanasekaran SengodanAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now