*/
Using System; using System.10;
class CopyFile {
static void Main(string[ ] args) { if (args.Length!= 2) {
Console.WriteLine(": CopyFile "); return;
}
// , try {
File.Copy(args[0], args[l]);
} catch(IOException exc) {
Console.WriteLine(" \" + exc.Message);
}
}
}
^ , FileStream . () . , . , * ().
Exists () GetLastAccessTime ()
File . : Exists () GetLastAccessTime (). Exists () , , GetLastAccessTime () . .
static bool Exists(string )
static DateTime GetLastAccessTime(string )
, . Exists () true, . GetLastAccessTime () DateTime, . (
DateTime , ToString () .) , IOException.
Exists () GetLastAccessTime () . , test. txt. , .
// Exists () GetLastAccessTime().
Using System; using System.10;
class ExistsDemo { static void Main() {
if(File.Exists("test.txt"))
Console.WriteLine(" . " + File.GetLastAccessTime("test.txt"));
Else
Console.WriteLine(" ");
}
}
, , GetCreationTime (), , GetLastWriteTime (). (UTC). .
-, , . , WriteLineO , , int double. WriteLineO . . , Read () "100", , , int. . Parse (), .
|
|
: C# , int double, (.. ) , .NET Framework. C# .NET Framework, . C# , .
.NET C# .
.NET
C#
Decimal
Decimal
Double
Double
Single
Float
In 116
Short
Int32
Int
Int64
Long
Ulntl6
Ushort
UInt32
Uint
Uint64
Ulong
Byte
Byte
Sbyte
Sbyte
System. , Int32 System. Int32. , #. , Parse (), .
Parse (). . . , , .
Decimal
Static
decimal Parse(string s)
Double
Static
double Parse(string s)
Single
Static
float Parse(string s)
Int 64
Static
long Parse (string s)
Int32
Static
int Parse(string s)
I n 116
|
|
Static
short Parse(string s)
Uint64
Static
ulong Parse(string s)
UInt32
Static
uint Parse(string s)
Ulntl6
Static
ushort Parse(string s)
Byte
Static
byte Parse(string s)
Sbyte
Static
sbyte Parse(string s)
Parse () FormatException, s , . , ArgumentNullException. s , OverflowException.
, , . , , . , ReadLine () Int32. Parse (). , Double. Parse () double.
// , .