惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
T
The Blog of Author Tim Ferriss
GbyAI
GbyAI
雷峰网
雷峰网
Last Week in AI
Last Week in AI
人人都是产品经理
人人都是产品经理
F
Fortinet All Blogs
酷 壳 – CoolShell
酷 壳 – CoolShell
T
Tailwind CSS Blog
Y
Y Combinator Blog
J
Java Code Geeks
S
SegmentFault 最新的问题
罗磊的独立博客
爱范儿
爱范儿
F
Full Disclosure
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
V2EX
G
Google Developers Blog
腾讯CDC
美团技术团队
Martin Fowler
Martin Fowler
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
D
DataBreaches.Net
大猫的无限游戏
大猫的无限游戏
博客园 - 【当耐特】
B
Blog
Recorded Future
Recorded Future
月光博客
月光博客
Blog — PlanetScale
Blog — PlanetScale
IT之家
IT之家
N
Netflix TechBlog - Medium
P
Proofpoint News Feed
云风的 BLOG
云风的 BLOG
博客园 - 聂微东
阮一峰的网络日志
阮一峰的网络日志
B
Blog RSS Feed
aimingoo的专栏
aimingoo的专栏
W
WeLiveSecurity
Recent Announcements
Recent Announcements
P
Palo Alto Networks Blog
Apple Machine Learning Research
Apple Machine Learning Research
MongoDB | Blog
MongoDB | Blog
G
GRAHAM CLULEY
A
Arctic Wolf
AWS News Blog
AWS News Blog
Project Zero
Project Zero
博客园 - Franky
V
Vulnerabilities – Threatpost

博客园 - Maxer`s Blog

用C#生成随机中文汉字验证码(转) 序列化与反序列化 - Maxer`s Blog - 博客园 大家救命啊:系统表更新导致数据库崩溃,有没有办法还原? //以解决,谢谢大家关注 一些我收集的常用正则表达式 JS常用正则表达式 SQLServer和Access、Excel数据传输简单总结 动态SQL语句 转-javascript 问题集合 - Maxer`s Blog 使用Session常见问题集锦 TreeView控件问题汇总 ASP.NET 2.0学习笔记之$ ASP.NET 2.0学习笔记之Object Tag Syntax - Maxer`s Blog 网站恢复正常了,感谢Howej ! 推荐一个好用的PDF转TXT软件 测试从dasblog发文章到博客园 [导入]注册了StartNow.CN域名 [导入]新年钟声响了,现在是2006了 [导入]今天去签了新电信息科技 [导入]应届毕业生该怎样准备你的未来
ASP.NET 2.0学习笔记之Code Directory
Maxer`s Blog · 2006-03-27 · via 博客园 - Maxer`s Blog

在ASP.NET 2.0中可以同是调用VB,C#中的类.
By default, the App_Code directory can only contain files of the same language. However, you may partition the App_Code directory into subdirectories (each containing files of the same language) in order to contain multiple languages under the App_Code directory. To do this, you need to register each subdirectory in the Web.config file for the application.
可以在WEB.CONFIG中申明一个用于放置其他语言的子目录.

web.config
-----------------------------------------------------------------------------------------------------------
<configuration>
  <system.web>
    <compilation>
      <codeSubDirectories>
        <add directoryName="Subdirectory"/>  // Your custom dirctionory which to contain the deferenet lanuage class such as vb
      </codeSubDirectories>
    </compilation>
  </system.web>
</configuration>
-----------------------------------------------------------------------------------------------------------

customClass.cs
-----------------------------------------------------------------------------------------------------------
using System;

public class CustomClass
{
    public String GetMessage(String input) {
        return "Hello " + input;
    }
}
-----------------------------------------------------------------------------------------------------------

SubDirectory/customClass.vb
-----------------------------------------------------------------------------------------------------------
Imports Microsoft.VisualBasic

Public Class CustomClass2

Public Function GetMessage(ByVal name As String) As String
        Return "Hello from VB " & name
    End Function

End Class
-----------------------------------------------------------------------------------------------------------

page.aspx
-----------------------------------------------------------------------------------------------------------
<%
@ page language="C#" %>

<script runat="server">

void Button1_Click(object sender, EventArgs e)
  {
    CustomClass c = new CustomClass();
    Label1.Text = c.GetMessage(TextBox1.Text);

    CustomClass2 c2 =

new CustomClass2();
    Label2.Text = c2.GetMessage(TextBox1.Text);
  }
</script>

<html>
<head>
    <title>ASP.NET Inline Pages</title>
</head>
<body>
    <form id="Form1" runat="server">
      <h1>Welcome to ASP.NET 2.0!</h1>
      <b>Enter Your Name:</b>
      <asp:TextBox ID="TextBox1" Runat="server"/>
      <asp:Button ID="Button1" Text="Click Me" OnClick="Button1_Click" Runat="server"/>
      <br />
      <br />
      <asp:Label ID="Label1" Runat="server" />
      <br />
      <asp:Label ID="Label2" Runat="server" />
    </form>
</body>
</html>
-----------------------------------------------------------------------------------------------------------