我無法將System.Windows.Forms
添加到我的WCF服務庫。無法將`System.Windows.Forms`引用添加到我的WCF服務庫
我想從我的方法GetItems(string path)
返回List<ListViewItem>
,我也嘗試添加System.Windows.Forms
的引用,但沒有發現它看起來像WCF服務庫不支持它。
任何想法我怎麼能做到這一點?
namespace WcfServiceLibrary1
{
[ServiceContract]
public interface IFileManager
{
[OperationContract]
List<ListViewItem> collection(string path);
}
}
這是我Item.cs
類:
namespace WcfServiceLibrary1
{
[DataContract]
public class Item
{
[DataMember]
public string name;
[DataMember]
public string path;
[DataMember]
public long size;
[DataMember]
public DateTime date;
}
}
我認爲你需要創建一個Windows窗體應用程序,並使用WCF服務作爲客戶端。然後你可以打電話給它,並在你的表格中顯示結果。 WCF的目的不是向用戶顯示任何數據。 – Fer 2012-04-13 05:10:51