如何编译VB函数 [英] How to compile VB functions

查看:54
本文介绍了如何编译VB函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ASP.NET for Dummies这本书学习ASP.NET。在介绍编写自己的函数的章节

中,我无法得到运行的例子

我用LOCALHOST调用它。它产生的IE无法找到页面错误因为

它不知道如何编译该函数。


我可以执行.ASPX示例就好了LOCALHOST。


我需要在PC上设置什么才能编译这些

功能?


以下是示例代码:


<%@ Page Explicit =" True"语言= QUOT; VB"调试= QUOT;真" %>

< html>

< script runat =" server">


函数RollDie作为整数

Dim Roll As Integer

随机化

Roll = Int(Rnd * 6)+ 1

返回(Roll )

结束功能


< / script>


< body>

< p>我会掷两个骰子;让我们看看

我们得到了什么!< / p>

<%

Dim FirstRoll,SecondRoll As Integer

FirstRoll = RollDie

SecondRoll = RollDie

%>

第一次滚动:<%= FirstRoll%>< ; br>

第二次滚动:<%= SecondRoll%>< br>

< / body>

< / html>

I am learning ASP.NET using the book, "ASP.NET for Dummies". In the chapter
introducing writing your own functions, I cannot get the example to run when
I call it with LOCALHOST. It produces the IE cannot find page error because
it doesn''t know how to compile the function.

I can execute .ASPX examples just fine using LOCALHOST.

What else do I need to do set up on my PC to be able to compile these
functions?

Here is the example code:

<%@Page Explicit="True" Language="VB" Debug="True" %>
<html>
<script runat="server">

Function RollDie As Integer
Dim Roll As Integer
Randomize
Roll = Int(Rnd * 6) + 1
Return(Roll)
End Function

</script>

<body>
<p>I''ll roll two dice; let''s see what
we get!</p>
<%
Dim FirstRoll, SecondRoll As Integer
FirstRoll = RollDie
SecondRoll = RollDie
%>
First roll: <%=FirstRoll%><br>
Second roll: <%=SecondRoll%><br>
</body>
</html>


推荐答案

>我用LOCALHOST调用它。它产生的IE无法找到页面错误

因为
> I call it with LOCALHOST. It produces the IE cannot find page error
because
它不知道如何编译该函数。


如果你在谈论一个404 Page Not Found错误,那就无所事事

编译任何内容。这意味着您在浏览器中请求的URL

在服务器上不存在。


-

HTH ,


Kevin Spencer

微软MVP

..Net开发人员
http://www.takempis.com

大事由
$ b组成$ b很多小东西。


" NRGeti" <纳克*** @ optonline.net>在消息中写道

新闻:iw ******************* @ news4.srv.hcvlny.cv.net ...我正在学习ASP .NET使用本书ASP.NET for Dummies。在介绍编写自己的函数的
章节中,当我用LOCALHOST调用它时,我无法得到运行
的示例。它产生的IE无法找到页面错误
,因为它不知道如何编译该函数。

我可以使用LOCALHOST执行.ASPX示例。

以下是示例代码:

< %@ Page Explicit =" True"语言= QUOT; VB"调试= QUOT;真" %>
< html>
< script runat =" server">

功能RollDie作为整数
Dim Roll As Integer
随机化
Roll = Int(Rnd * 6)+ 1
返回(Roll)
结束功能

< / script>

< body>
< p>我会掷两个骰子;让我们看看我们得到了什么!< / p>
<%
Dim FirstRoll,SecondRoll As Integer
FirstRoll = RollDie
SecondRoll = RollDie
%>
第一次滚动:<%= FirstRoll%>< br>
第二次滚动:<%= SecondRoll%>< br>
< / body>
< / html>
it doesn''t know how to compile the function.
If you''re talking about a 404 Page Not Found error, that has nothing to do
with compiling anything. It means that the URL you requested in your browser
doesn''t exist on the server.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

"NRGeti" <ng***@optonline.net> wrote in message
news:iw*******************@news4.srv.hcvlny.cv.net ... I am learning ASP.NET using the book, "ASP.NET for Dummies". In the chapter introducing writing your own functions, I cannot get the example to run when I call it with LOCALHOST. It produces the IE cannot find page error because it doesn''t know how to compile the function.

I can execute .ASPX examples just fine using LOCALHOST.

What else do I need to do set up on my PC to be able to compile these
functions?

Here is the example code:

<%@Page Explicit="True" Language="VB" Debug="True" %>
<html>
<script runat="server">

Function RollDie As Integer
Dim Roll As Integer
Randomize
Roll = Int(Rnd * 6) + 1
Return(Roll)
End Function

</script>

<body>
<p>I''ll roll two dice; let''s see what
we get!</p>
<%
Dim FirstRoll, SecondRoll As Integer
FirstRoll = RollDie
SecondRoll = RollDie
%>
First roll: <%=FirstRoll%><br>
Second roll: <%=SecondRoll%><br>
</body>
</html>



这可能是真的。如果我把这个例子放在我自己的服务器上,那么它就会编译并运行
。现在的问题是如何从

LOCALHOST URL执行它?从服务器运行的所有系统内容都存在于我的PC上

所以我如何指示LOCALHOST使用它?

" Kevin Spencer" <柯*** @ DIESPAMMERSDIEtakempis.com>在消息中写道

新闻:Oi ************** @ TK2MSFTNGP12.phx.gbl ...
That is probably true. If I put this example on my own server, then it
compiles and runs. The question now is how can I get it to execute from the
LOCALHOST URL? All the system stuff that ran from the server exists on my PC
so how would I direct LOCALHOST to use it?
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:Oi**************@TK2MSFTNGP12.phx.gbl...
我用LOCALHOST调用它。它产生IE无法找到页面错误,因为
I call it with LOCALHOST. It produces the IE cannot find page error because
它不知道如何编译该函数。
it doesn''t know how to compile the function.



如果你在谈论404页面未找到错误,与编译任何内容无关。这意味着您在



If you''re talking about a 404 Page Not Found error, that has nothing to do
with compiling anything. It means that the URL you requested in your



浏览器中请求的URL在服务器上不存在。

-
HTH,
Kevin Spencer
Microsoft MVP
.Net开发人员
http://www.takempis.com
大事由很多小事组成。

NRGeti <纳克*** @ optonline.net>在消息中写道
新闻:iw ******************* @ news4.srv.hcvlny.cv.net ...


browser doesn''t exist on the server.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

"NRGeti" <ng***@optonline.net> wrote in message
news:iw*******************@news4.srv.hcvlny.cv.net ...

我正在使用ASP.NET for Dummies这本书学习ASP.NET。在
I am learning ASP.NET using the book, "ASP.NET for Dummies". In the


章节

介绍编写自己的函数时,我无法在
introducing writing your own functions, I cannot get the example to run
I时运行


用LOCALHOST调用它。它产生IE无法找到页面错误

I call it with LOCALHOST. It produces the IE cannot find page error


因为

它不知道如何编译该函数。

我可以执行.ASPX示例就好了使用LOCALHOST。

我需要在PC上设置什么才能编译这些功能?

这是一个例子代码:

<%@ Page Explicit =" True"语言= QUOT; VB"调试= QUOT;真" %>
< html>
< script runat =" server">

功能RollDie作为整数
Dim Roll As Integer
随机化
Roll = Int(Rnd * 6)+ 1
返回(Roll)
结束功能

< / script>

< body>
< p>我会掷两个骰子;让我们看看我们得到了什么!< / p>
<%
Dim FirstRoll,SecondRoll As Integer
FirstRoll = RollDie
SecondRoll = RollDie
%>
第一次滚动:<%= FirstRoll%>< br>
第二次滚动:<%= SecondRoll%>< br>
< / body>
< / html>
it doesn''t know how to compile the function.

I can execute .ASPX examples just fine using LOCALHOST.

What else do I need to do set up on my PC to be able to compile these
functions?

Here is the example code:

<%@Page Explicit="True" Language="VB" Debug="True" %>
<html>
<script runat="server">

Function RollDie As Integer
Dim Roll As Integer
Randomize
Roll = Int(Rnd * 6) + 1
Return(Roll)
End Function

</script>

<body>
<p>I''ll roll two dice; let''s see what
we get!</p>
<%
Dim FirstRoll, SecondRoll As Integer
FirstRoll = RollDie
SecondRoll = RollDie
%>
First roll: <%=FirstRoll%><br>
Second roll: <%=SecondRoll%><br>
</body>
</html>




>我用LOCALHOST调用它。它产生的IE无法找到页面错误

因为
> I call it with LOCALHOST. It produces the IE cannot find page error
because
它不知道如何编译该函数。


如果你在谈论一个404 Page Not Found错误,那就无所事事

编译任何内容。这意味着您在浏览器中请求的URL

在服务器上不存在。


-

HTH ,


Kevin Spencer

微软MVP

..Net开发人员
http://www.takempis.com

大事由
$ b组成$ b很多小东西。


" NRGeti" <纳克*** @ optonline.net>在消息中写道

新闻:iw ******************* @ news4.srv.hcvlny.cv.net ...我正在学习ASP .NET使用本书ASP.NET for Dummies。在介绍编写自己的函数的
章节中,当我用LOCALHOST调用它时,我无法得到运行
的示例。它产生的IE无法找到页面错误
,因为它不知道如何编译该函数。

我可以使用LOCALHOST执行.ASPX示例。

以下是示例代码:

< %@ Page Explicit =" True"语言= QUOT; VB"调试= QUOT;真" %>
< html>
< script runat =" server">

功能RollDie作为整数
Dim Roll As Integer
随机化
Roll = Int(Rnd * 6)+ 1
返回(Roll)
结束功能

< / script>

< body>
< p>我会掷两个骰子;让我们看看我们得到了什么!< / p>
<%
Dim FirstRoll,SecondRoll As Integer
FirstRoll = RollDie
SecondRoll = RollDie
%>
第一次滚动:<%= FirstRoll%>< br>
第二次滚动:<%= SecondRoll%>< br>
< / body>
< / html>
it doesn''t know how to compile the function.
If you''re talking about a 404 Page Not Found error, that has nothing to do
with compiling anything. It means that the URL you requested in your browser
doesn''t exist on the server.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

"NRGeti" <ng***@optonline.net> wrote in message
news:iw*******************@news4.srv.hcvlny.cv.net ... I am learning ASP.NET using the book, "ASP.NET for Dummies". In the chapter introducing writing your own functions, I cannot get the example to run when I call it with LOCALHOST. It produces the IE cannot find page error because it doesn''t know how to compile the function.

I can execute .ASPX examples just fine using LOCALHOST.

What else do I need to do set up on my PC to be able to compile these
functions?

Here is the example code:

<%@Page Explicit="True" Language="VB" Debug="True" %>
<html>
<script runat="server">

Function RollDie As Integer
Dim Roll As Integer
Randomize
Roll = Int(Rnd * 6) + 1
Return(Roll)
End Function

</script>

<body>
<p>I''ll roll two dice; let''s see what
we get!</p>
<%
Dim FirstRoll, SecondRoll As Integer
FirstRoll = RollDie
SecondRoll = RollDie
%>
First roll: <%=FirstRoll%><br>
Second roll: <%=SecondRoll%><br>
</body>
</html>



这篇关于如何编译VB函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆