简体   繁体   中英

convert classic ASP to ASP.NET C#

<%
       Dim xmlDoc; 
Dim objNodeList;
Dim count;

set xmlDoc = Server.CreateObject("Msxml2.DOMDocument.6.0");

xmlDoc.validateOnParse = False;
xmlDoc.async = False;

xmlDoc.loadXML("<div>" & Request.Form("inTransContent")   & "</div>");

Else
      Set objNodeList = xmlDoc.documentElement.selectNodes("//text()");
      count = objNodeList.length;

      For i = 1 To count 
           objNodeList(i-1).insertData 0, "XYZ " ;
           objNodeList(i-1).insertData objNodeList(i-1).length, " XYZ" ;
      Next 

      Response.Write(xmlDoc.documentElement.xml);
End If

%>

Hi, I need to convert this code to C# and I'm not that familiar with vbscript!!

Kindly can anyone convert this code!!

Thanks

Look here!!! (An SO question asking how to call native routines from managed)

And here!!! (An online utility for converting between different .NET languages)

One of the wonderful things in .NET is that you can write it using different languages.

One of those is VB.NET that should be backward compatible enough to support your code, and even if not then converting classic ASP to VB.NET should be easy as the syntax is the same.

So just change the project to VB.NET instead of C# and you're good to go.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM