扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:廖煜嵘编译 来源:天极网 2007年11月7日
关键字: Windows
<system.web> <profile> <properties> <add name="language" type="string"/> <group name="Info"> <add name="DateSelected" type="System.DateTime"/> <add name="LastModified" type="System.DateTime"/> </group> </properties> </profile> |
Profile.language = "en-US" Profile.Info.LastModified = Now Profile.Info.DateSelected = Calendar1.SelectedDate |
Sub btnSet_Click(ByVal sender As Object, _ ByVal e As System.EventArgs) Profile.language = ddlLanguage.SelectedItem.Value End Sub |
Sub Calendar1_SelectionChanged(ByVal sender As Object, _ ByVal e As System.EventArgs) Profile.Info.DateSelected = Calendar1.SelectedDate Profile.Info.LastModified = Now End Sub |
Sub Page_Load(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles Me.Load Calendar1.SelectedDate = Profile.Info.DateSelected Response.Write("Date set on " Profile.Info.LastModified) End Sub |
Dim lang As System.Globalization.CultureInfo '读取用户在下拉框中选取的语言值 Dim selectedLang As String = Request("ddlLanguage") '如果用户选择auto,则在下拉框中显示AUTO的选择项 If selectedLang = "Auto" Then ddlLanguage.SelectedIndex = 2 Exit Sub End If ' 如果是POSTBACK,则读取原来已经保存的语言信息 If selectedLang IsNot Nothing Then lang = New System.Globalization.CultureInfo(selectedLang) Else '如果是第一次调用页面 If Profile.language <> "Auto" Then lang = New System.Globalization.CultureInfo(Profile.language) Select Case Profile.language Case "en-US" : ddlLanguage.SelectedIndex = 0 Case "zh-CN" : ddlLanguage.SelectedIndex = 1 Case "auto" : ddlLanguage.SelectedIndex = 2 End Select Else '---if language is auto, then exit ddlLanguage.SelectedIndex = 2 Exit Sub End If End If System.Threading.Thread.CurrentThread.CurrentCulture = lang System.Threading.Thread.CurrentThread.CurrentUICulture = lang lblWelcomeMessage.Text = Resources.Resource.WelcomeMsg.ToString Page.Title = Resources.Resource.PageTitle.ToString lblSelectLanguage.Text = Resources.Resource.SelectLanguage.ToString |
lang = New System.Globalization.CultureInfo(selectedLang) |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者