开发者

convert classic ASP to ASP.NET C#

开发者 https://www.devze.com 2023-02-18 03:31 出处:网络
<% Dim xmlDoc; Dim objNodeList; Dim count; set xmlDoc = Server.CreateObject(\"Msxml2.DOMDocument.6.0\");
<%
       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).insert开发者_如何学CData 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消