关于WEBSERVICES的一个问题.

eatfox 2004-11-25 01:31:06
我建立一个ASP.NET WEB服务项目,程序自动生成HELLO WORLD后编译,再在调试中执行,程序会自动在浏缆器中输入HTTP连接URL地址,这样无须我动手就可以看到ASMX文件的内容,但我用我看的书的源代码编译后,程序却不会自动在浏缆器中输入HTTP连接URL地址,只弹出一个空白的浏览器(ABOUT),我查看了下代码,请问这是怎么回事啊?
...全文
96 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
eatfox 2004-11-25
  • 打赏
  • 举报
回复
不会吧,实际上,我就是从网上下载的,动都没动,直接编译,而且也通过了,而且我可以手工加载ASMX没有问题,应该不会有问题吧.
实现自动将URL加载到浏览器的究竟是什么语句或功能?

附:源程序的头文件(DEITEL所著VISUAL C++.NET大学教程第762页):


#pragma once

using namespace System;
using namespace System::Web;
using namespace System::Web::Services;
using namespace System::Text;

namespace HugeInteger
{
/// WARNING: If you change the name of this class, you will need to change the
/// 'Resource File Name' property for the managed resource compiler tool
/// associated with all .resx files this class depends on. Otherwise,
/// the designers will not be able to interact properly with localized
/// resources associated with this form.

// performs operations on large integers
[ WebServiceAttribute(
Namespace = "http://www.deitel.com/ch20/HugeInteger",
Description = "A Web service which provides methods that"
" can manipulate large integer values." ) ]
public __gc
class HugeIntegerClass : public System::Web::Services::WebService
{

public:
HugeIntegerClass()
{
InitializeComponent();
number = new int __gc[ MAXIMUM ];
}
protected:
void Dispose(Boolean disposing)
{
if (disposing && components)
{
components->Dispose();
}
__super::Dispose(disposing);
}

private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container * components;

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent()
{
}

public:

int number __gc[];

// indexed property that accepts an integer parameter
__property int get_Index( int index )
{
return number[ index ];
}

__property void set_Index( int index, int value )
{
number[ index ] = value;
}

String *ToString();

HugeIntegerClass *FromString( String *integer );

[ WebMethod( Description = "Adds two huge integers." ) ]
String *Add( String *first, String *second );

[ WebMethod ( Description = "Subtracts two huge integers." ) ]
String *Subtract( String *first, String *second );

[ WebMethod( Description = "Determines whether the first "
"integer is larger than the second integer." ) ]
bool Bigger( String *first, String *second );

[ WebMethod( Description = "Determines whether the "
"first integer is smaller than the second integer." ) ]
bool Smaller( String *first, String *second );

[ WebMethod( Description = "Determines whether the "
"first integer is equal to the second integer." ) ]
bool EqualTo( String *first, String *second );

private:
static const int MAXIMUM = 100;
void Borrow( HugeIntegerClass *integer, int place );
};
}
  • 打赏
  • 举报
回复
你把书中的源代码copy过去,替换那个返回hello world的方法试试,你可能是没写对[WebMethod]
liulxmooo 2004-11-25
  • 打赏
  • 举报
回复
你的错误究竟是什么?看半天没明白
jxzhang615 2004-11-25
  • 打赏
  • 举报
回复
帮顶!

7,539

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 VC.NET
社区管理员
  • VC.NET社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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