LastModified() public method

public LastModified ( ) : long
return long
コード例 #1
0
ファイル: Lmhosts.cs プロジェクト: Cyber-Forensic/Potato
		internal static NbtAddress GetByName(Name name)
		{
			lock (typeof(Lmhosts))
			{
				NbtAddress result = null;
				try
				{
					if (Filename != null)
					{
						FilePath f = new FilePath(Filename);
						long lm;
						if ((lm = f.LastModified()) > _lastModified)
						{
							_lastModified = lm;
							Tab.Clear();
							_alt = 0;
							Populate(new FileReader(f));
						}
						result = (NbtAddress)Tab[name];
					}
				}
				catch (FileNotFoundException fnfe)
				{
					if (_log.Level > 1)
					{
						_log.WriteLine("lmhosts file: " + Filename);
						Runtime.PrintStackTrace(fnfe, _log);
					}
				}
				catch (IOException ioe)
				{
					if (_log.Level > 0)
					{
						Runtime.PrintStackTrace(ioe, _log);
					}
				}
				return result;
			}
		}