我包括SoundTouchSharp作爲參考(創建一個.dll 版本的cs文件後),並且我還將SoundTouchSharp.dll和 soundtouch.dll放入bin/Debug文件夾中。
如果要在另一個名稱空間中使用名稱空間BigMansStuff.PracticeSharp.Core
中的SoundTouchSharp
類,則必須將其公開,然後創建該庫。
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace BigMansStuff.PracticeSharp.Core
{
/// <summary>
/// .NET C# Wrapper to the SoundTouch Native C++ Audio library
/// </summary>
/// <see cref="http://www.surina.net/soundtouch/index.html"/>
public class SoundTouchSharp: IDisposable
{
//...
}
//...
}
然後在你的項目,你必須添加一個使用指令,允許使用該類型的命名空間:
using BigMansStuff.PracticeSharp.Core;
做他們創造什麼命名空間? – SLaks 2013-03-10 20:13:17
恩,是BigMansStuff.PracticeSharp.SoundTouchSharp嗎?這裏是圖書館,對不起,我對C#沒有經驗。 https://code.google.com/p/practicesharp/source/browse/trunk/PracticeSharpApp/Core/SoundTouchSharp.cs?r=157 – m00nbeam360 2013-03-10 20:15:13
http://msdn.microsoft.com/en-us/library/0d941h9d。 aspx – SLaks 2013-03-10 20:23:39