標籤

more tags...

最新回覆

[ASP.NET]利用Web Service上傳檔案,整合WebFrom與WinForm

很久沒寫文章了,最近公司的案子很趕,沒什麼時間研究新東西

今天就寫一篇簡單的Web Service上傳檔案,並且整合在WebFromWinForm使用者介面

首先要準備一支Web Service(上傳檔案用,WebForm或WinForm都會call這支)

接下來準備WebForm與WinForm的UI介面來上傳檔案

Web Service

Fileupload.asmx

Fileupload.cs

在WebForm或WinForm專案都要加入Web參考,如下圖所示

WebForm

ServiceFileupload.aspx

ServiceFileupload.aspx.cs

WinForm

ServiceFileupload.cs


參考網址:

http://www.c-sharpcorner.com/UploadFile/subcom/003202008114211AM/0.aspx

推到 Twitter!
推到 Plurk!


 

2009/1/6 20:33| 閱讀數 : 10809 | 2 人收藏 1 人推薦 我要推薦 | 9 Comments | 文章分類 : ASP.NET ASP.NET(Web Service) 訂閱


回覆

# re: [ASP.NET]利用Web Service上傳檔案,整合WebFrom與WinForm, Posted by 小驢 on 2009/1/14 上午 09:52  回覆

前輩你的bolg文章好豐富阿~
這裡可以挖到不少寶,學到不少東西呢
謝謝你的分享~
 

# re: [ASP.NET]利用Web Service上傳檔案,整合WebFrom與WinForm, Posted by john on 2009/1/20 上午 10:30  回覆

好物一枚,讚哦!

# re: [ASP.NET]利用Web Service上傳檔案,整合WebFrom與WinForm, Posted by 小偉偉 on 2009/5/2 上午 01:50  回覆

您好,我用了您的方法後,在2MB左右的檔案都是可行的,可是太大的檔案就會發生連線中斷現象,請問這是怎麼一回事?是我有地方沒注意到嗎?

# re: [ASP.NET]利用Web Service上傳檔案,整合WebFrom與WinForm, Posted by puma on 2009/5/3 下午 07:12  回覆

to 小偉偉,

你參考下面這篇文章的介紹調整web.config看看..

httpRuntime 的 maxRequestLength 與 executeTimeout

http://www.dotblogs.com.tw/code6421/archive/2008/05/07/3886.aspx

# re: [ASP.NET]利用Web Service上傳檔案,整合WebFrom與WinForm, Posted by jandy on 2009/6/1 下午 12:22  回覆

請問...我是新手...這是上傳的範例...如何建立接收的 web service

# re: [ASP.NET]利用Web Service上傳檔案,整合WebFrom與WinForm, Posted by alice on 2009/10/21 下午 02:01  回覆

我參考了您的範例
但會出現
"找不到型別或命名空間名稱 'Service_Fileupload' (您是否遺漏 using 指示詞或組件參考?)"
的錯誤
可以請教是甚麼原因嗎

# re: [ASP.NET]利用Web Service上傳檔案,整合WebFrom與WinForm, Posted by alice on 2009/10/21 下午 04:08  回覆

我重新試過,開一個全新的專案沒有問題
此範例真的很好用
謝謝

# re: [ASP.NET]利用Web Service上傳檔案,整合WebFrom與WinForm, Posted by 坎尼 on 2009/10/22 下午 04:22  回覆

to alice,

你可能要先了解一下 namespace 的意義
http://msdn.microsoft.com/zh-tw/library/z2kcy19k.aspx

Service_Fileupload 應該是給 Web Service 的命名空間(在加入 Web Service 參考時給予的)

# re: [ASP.NET]利用Web Service上傳檔案,整合WebFrom與WinForm, Posted by jimmy on 2010/3/17 下午 10:36  回覆

小弟是新手
請問圖片上傳後 是儲存在本機端的web services嗎?
還是要另外寫資料庫儲存圖片呢?
感謝解答

發表回覆

標題: *
姓名: *
Email: (將不會被顯示)
Url:
回覆: *
登入後使用進階評論
Please add 1 and 5 and type the answer here:
F6 Team logo


用BloggerAds 替自已加薪

每月文章

文章分類

推薦討論區

推薦部落格