关于构建“Web 服务”的问题...

huawengang 2007-09-21 02:57:27
我是VB.Net的初学者。
最近在看“VB.Net入门经典”,感觉收益匪浅。
我看到第20章的“构建Web服务”的相关内容是有点困惑,所以来此向各位高手请教。

我按照书上的例子代码(是一个“图片服务器服务”的例子),服务器部分的程序已经创建好了,而且也测试成功了。但是当我做到“图片服务器客户程序”时就有问题了,客户端程序运行后抛出异常...

客户程序代码如下:
(代码主要内容就是把Web服务器里面的3个放有图片的文件夹的名字加载到Windows_Form上的ComboBox里面)

Public Class Form1
Inherits System.Windows.Forms.Form


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'get the pictrues...
Try
'create a connection to the service...
Dim service As New PictureService.Service

'get a list of the folders...
Dim folderNames() As String
folderNames = service.GetPictureFolders

'go through the list and add each name...
Dim folderName As String
For Each folderName In folderNames
cboFolders.Items.Add(folderName)
Next

Catch ex As Exception
HandleException(ex)
End Try
End Sub

'HandleException-handle a Web service exception...
Private Function HandleException(ByVal e As Exception)
'loop through the inner exceptions...
Do While Not e.InnerException Is Nothing
e = e.InnerException
Loop

'report the problem...
MessageBox.Show("An exception occured." & e.Message)
End Function
End Class

运行后抛出的异常信息是“HTTP Status 401:Access Denied request false!”且文件夹的名字没有加载进去...

请高手赐教...
...全文
56 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
huawengang 2007-09-24
  • 打赏
  • 举报
回复
是的

应该就是这个错误信息

因为我是用的日文系统

所以翻译的不准确

请问阁下知道哪里有问题吗?
新鲜鱼排 2007-09-22
  • 打赏
  • 举报
回复
Access Denied ~~~~~~
No necessary right to access that server.

16,553

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧