超级菜鸟叫救命!!
using System;
namespace test
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class Test
{
static void SplitPath(string path,out string dir,out string name)
{
int i=path.Length;
while(i>0)
{
char ch=path[i-1];
if(ch=="\\"||ch=="/"||ch==":")break;
i--;
}
dir=path.Substring(0,i);
name=path.Substring(i);
}
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
string dir,name;
SplitPath("c:\\windows\\System\\hello.txt",out dir,out name);
Console.WriteLine(dir);
Console.WriteLine(name);
//
// TODO: 在此处添加代码以启动应用程序
//
}
}
}
错误提示:
E:\myPg\test\Class1.cs(16): 运算符“==”无法应用于“char”和“string”类型的操作数
以上程序的错误该如何修改.
namespace test
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class Test
{
static void SplitPath(string path,out string dir,out string name)
{
int i=path.Length;
while(i>0)
{
char ch=path[i-1];
if(ch=="\\"||ch=="/"||ch==":")break;
i--;
}
dir=path.Substring(0,i);
name=path.Substring(i);
}
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
string dir,name;
SplitPath("c:\\windows\\System\\hello.txt",out dir,out name);
Console.WriteLine(dir);
Console.WriteLine(name);
//
// TODO: 在此处添加代码以启动应用程序
//
}
}
}
错误提示:
E:\myPg\test\Class1.cs(16): 运算符“==”无法应用于“char”和“string”类型的操作数
以上程序的错误该如何修改.
...全文
相关推荐
Git超级教程菜鸟教程
Git超级教程菜鸟教程Git超级教程菜鸟教程Git超级教程菜鸟教程Git超级教程菜鸟教程Git超级教程菜鸟教程Git超级教程菜鸟教程Git超级教程菜鸟教程Git超级教程菜鸟教程
电脑超精品技巧菜鸟必收藏!!.doc
电脑超精品技巧菜鸟必收藏!!.doc
超级菜鸟DirectX8游戏编程入门讲座
超级菜鸟DirectX8游戏编程入门讲座原著(日)前田 稔翻译(中)燕尘
我的小作品无脚本flash动画小浣熊超级简单易学,专对菜鸟级别!
无脚本flash动画我的小作品无脚本flash动画小浣熊超级简单易学,专对菜鸟级别!
魔方超级菜鸟入门教程(自己的).doc
每一个超级菜鸟都有可能成为魔方的高手,只差一个勇敢的开始。


