internal WebBrowserCacheEntry(INTERNET_CACHE_ENTRY_INFOA entryInfo) { string sourceUrlStr = (string)Marshal.PtrToStringAnsi(entryInfo.lpszSourceUrlName); if (Uri.IsWellFormedUriString(sourceUrlStr, UriKind.Absolute)) { m_sourceUrl = new Uri(sourceUrlStr); } else { m_sourceUrl = new Uri("http://localhost"); } m_localFilepath = (string)Marshal.PtrToStringAnsi(entryInfo.lpszLocalFileName); m_useCount = (int)entryInfo.dwUseCount; m_hitRate = (int)entryInfo.dwHitRate; if (System.IO.File.Exists(m_localFilepath)) { m_lastModifiedTime = System.IO.File.GetLastWriteTime(m_localFilepath); m_lastAccessTime = System.IO.File.GetLastAccessTime(m_localFilepath); } else { m_lastModifiedTime = new DateTime(); m_lastAccessTime = new DateTime(); } //m_lastSyncTime = ConvertFILETIME( entryInfo.LastSyncTime ); }
internal WebBrowserCacheEntry( INTERNET_CACHE_ENTRY_INFOA entryInfo ) { string sourceUrlStr = (string) Marshal.PtrToStringAnsi( entryInfo.lpszSourceUrlName ); if( Uri.IsWellFormedUriString( sourceUrlStr, UriKind.Absolute ) ) m_sourceUrl = new Uri( sourceUrlStr ); else m_sourceUrl = new Uri( "http://localhost" ); m_localFilepath = (string) Marshal.PtrToStringAnsi( entryInfo.lpszLocalFileName ); m_useCount = (int) entryInfo.dwUseCount; m_hitRate = (int) entryInfo.dwHitRate; if( System.IO.File.Exists( m_localFilepath ) ) { m_lastModifiedTime = System.IO.File.GetLastWriteTime( m_localFilepath ); m_lastAccessTime = System.IO.File.GetLastAccessTime( m_localFilepath ); } else { m_lastModifiedTime = new DateTime(); m_lastAccessTime = new DateTime(); } //m_lastSyncTime = ConvertFILETIME( entryInfo.LastSyncTime ); }