如何将XML文件转换成一个.NET类? [英] How to convert an XML file into a .Net class?
本文介绍了如何将XML文件转换成一个.NET类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人能提醒我如何从一个XML文件中创建一个.NET类?
Can someone please remind me how to create a .Net class from an XML file?
我会$ PFER批处理命令p $,还是有办法将其整合到外壳。
I would prefer the batch commands, or a way to integrate it into the shell.
谢谢!
推荐答案
下面的批次会在当前目录下创建一个.NET的类从 XML 。
所以... XML - > XSD - > VB
The below batch will create a .Net Class from XML in the current directory.
So... XML -> XSD -> VB
(随时随意替代CS的语言)
(Feel free to substitute CS for Language)
在%USERPROFILE%\的SendTo目录中创建一个 Convert2Class.Bat 。
然后复制/保存如下:
Create a Convert2Class.Bat in the %UserProfile%\SendTo directory.
Then copy/save the below:
@Echo off
Set XsdExePath="C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\XSD.exe"
Set Language=VB
%~d1
CD %~d1%~p1
%XsdExePath% "%~n1.xml" /nologo
%XsdExePath% "%~n1.xsd" /nologo /c /language:%Language%
作品在我的机器 - GOOD LUCK !!
Works on my machine - Good Luck!!
这篇关于如何将XML文件转换成一个.NET类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文