Sometimes it is always necessary to filter useless things. The implementation of the lyrics filtering tool V1.1 (provide download)

Source: Internet
Author: User
Tags readfile

I wrote an article about V1.0 last week. Later I found several problems and changed it to V1.1. The main problems are as follows: Download the entire project.

1. In V1.0, the lyrics file is directly overwritten. If there is no backup, it will be miserable. The target path is added here. If not selected, the original file is overwritten by default.

2. Some files cannot be processed during usage in V1.0. That is, an exception occurs. If no processing is done, no tracing is available. The logging function is added here.

3. A Bug in V1.0. When filtering the lyrics, this row will not exist because it is recorded in the ArrayList. Therefore, the number of loops is --, otherwise, some rows that meet the deletion conditions cannot be deleted.

After modification, the main interface is as follows:

The modified filter class is as follows:

 

Code

Public class Filter
{
Private ArrayList content = new ArrayList ();
Private FileIO fileio = new FileIO ();
Private string [] patterns;

Public void ReadFile (string path)
{
Content. Clear ();
Fileio. OpenReadFile (path );
While (! Fileio. IsEof ())
{
Content. Add (fileio. ReadLine ());
}
Fileio. CloseReadFile ();
}
Public void Process (string path)
{
ReadFile (path );
FileFilter ();
If (Manager. objectpath = "")
{
WriteFile (path );
}
Else
{
WriteFile (Manager. objectpath + "\" + path. Substring (path. LastIndexOf ("\") + 1 ));
}
}
Public void FileFilter ()
{
Patterns = Manager. patterns;
For (int I = 0; I <content. Count; I ++)
{
For (int j = 0; j <patterns. Length; j ++)
{
If (content [I]. ToString (). Contains (patterns [j])
{
Content. RemoveAt (I );
I --;
Break;
}
}
}
}
Public void WriteFile (string path)
{
Fileio. OpenWriteFile (path );
Foreach (string str in content)
{
Fileio. WriteLine (str. ToString ());
}
Fileio. CloseWriteFile ();
}
}

 

:/Files/yueyue_effecfm/lrcopv1.1.rar

Finally, I recommended my company's somusic software to everyone. I thought it was good to use it.

Somusic is a powerful music Voice Search software and music player software. It supports singing search, music radar, voice search, and other functions. It also supports PC/mobile phone local search and player functions.
On the basis of Version 2.0, version 1.0 fixes some bugs and enhances the library.

With this software, you can easily find a song that you don't remember and download it.

:/Files/yueyue_effecfm/SoPlayerS60V2.rar

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.