{
string strLocalFile="..\\..\\"+args[0].ToString();
……………………;
}
索引超出数组界限??string[] args 代表什么意思???
求高手指点!!!谢谢
可为什么在运行到string strLocalFile="..\\..\\"+args[0].ToString();时提示索引超出数组界限呢?
我是刚起步的菜鸟,希望高手能解释的详细一点。谢谢!!!
完整源码如下:
using System;
using System.Xml;
namespace Validation
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class Class1
{
private static void ValidateDocument(string strXMLDocName)
{
string strXMLfile=strXMLDocName;
XmlTextReader objXTRead=new XmlTextReader(strXMLfile);
XmlValidatingReader objXValRead=new XmlValidatingReader(objXTRead);
objXValRead.ValidationType=ValidationType.Schema;
while(objXValRead.Read()){}
objXTRead.Close();
objXValRead.Close();
Console.WriteLine("Validation Completed for "+strXMLDocName);
Console.ReadLine();
}
[STAThread]
static void Main(string[] args)
{
string strLocalFile="../../"+args[0].ToString();
ValidateDocument(strLocalFile);
}
}
}