Пример #1
0
    public string DeleteFile(int fileID)
    {
        BLOTextFile tf;

        tf = BLOTextFile.Edit(fileID);
        try
        {
            System.IO.File.Delete(tf.GetFilePath(Server.MapPath("~/Files")));
        }
        catch
        {
            return(null);
        }
        tf.Delete();
        return(null);
    }
Пример #2
0
    public string GetFileDetails(int fileID)
    {
        StringBuilder sb;
        BLOTextFile   tf;

        sb = new StringBuilder();
        tf = BLOTextFile.Edit(fileID);
        sb.Append("<File>\r\n");
        sb.AppendFormat(" <ID>{0}</ID>\r\n", tf.ID);
        sb.AppendFormat(" <SongName>{0}</SongName>\r\n", tf.SongName);
        sb.AppendFormat(" <ArtistName>{0}</ArtistName>\r\n", tf.ArtistName);
        sb.AppendFormat(" <AlbumName>{0}</AlbumName>\r\n", tf.AlbumName);
        sb.AppendFormat(" <Year>{0}</Year>\r\n", tf.Year.HasValue ? tf.Year.Value.ToString() : "");
        sb.AppendFormat(" <SongWriters>{0}</SongWriters>\r\n", tf.SongWriters);
        sb.AppendFormat(" <Duration>{0}</Duration>\r\n", tf.Duration);
        sb.Append("</File>");
        return(sb.ToString());
    }