6.0(推荐),在安装的时候选择asp.net组件,安装完成之后就会支持asp.net很简单。如果需要安装到asp.net2.0则需要下载2.0,然后进行安装,安装的时候注意关闭其它所运行的正常。
文章来源:服务中国
http://www.chinaser.net
#region Language Operation/// <summary>
/// 设置app.config中的Language的value.
/// </summary>
/// <param name="AppKey">key</param>
/// <param name="AppValue">value</param>
public void SetLanguageValue(string AppKey, string AppValue)
{
XmlDocument xDoc = new XmlDocument()
string configpath = System.Reflection.Assembly.GetExecutingAssembly().CodeBase + ".config"
string path = configpath.Substring(8)
//此处配置文件在程序目录下
xDoc.Load(path)
XmlNode xNode
XmlElement xElem1
XmlElement xElem2
xNode = xDoc.SelectSingleNode("//appSettings")
xElem1 = (XmlElement)xNode.SelectSingleNode("//add[@key='" + AppKey + "']")
if (xElem1 != null)
{
xElem1.SetAttribute("value", AppValue)
}
else
{
xElem2 = xDoc.CreateElement("add")
xElem2.SetAttribute("key", AppKey)
xElem2.SetAttribute("value", AppValue)
xNode.AppendChild(xElem2)
}
xDoc.Save(path)
}
public void SetCurrentLanguageIMG()
{
设置调用的资源文件语言包
switch (OctoSTPNet.Method.Language.LanguageType)
{
case "zh-CHS":
{
menuSChinese1.Checked = Janus.Windows.UI.InheritableBoolean.True
menuEnglish.Checked = Janus.Windows.UI.InheritableBoolean.False
menuTChinese.Checked = Janus.Windows.UI.InheritableBoolean.False
// menuSChinese.Image = OctoSTPNet.Properties.Resources.Tip
//menuEnglish.Image = null
//menuTChinese.Image = null
}
break
case "zh-TW":
{
menuSChinese1.Checked = Janus.Windows.UI.InheritableBoolean.False
menuEnglish.Checked = Janus.Windows.UI.InheritableBoolean.False
menuTChinese.Checked = Janus.Windows.UI.InheritableBoolean.True
}
break
default:
{
menuSChinese1.Checked = Janus.Windows.UI.InheritableBoolean.False
menuEnglish.Checked = Janus.Windows.UI.InheritableBoolean.True
menuTChinese.Checked = Janus.Windows.UI.InheritableBoolean.False
}
break
}
}
private void englishToolStripMenuItem_Click_1(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e)
{
SetLanguageValue("LanguageType", "EN")
menuSChinese1.Checked = Janus.Windows.UI.InheritableBoolean.False
menuEnglish.Checked = Janus.Windows.UI.InheritableBoolean.True
menuTChinese.Checked = Janus.Windows.UI.InheritableBoolean.False
MessageBoxManager.Show("Please Re-Start OctO to view new Language!", "OctO-Change Language")
}
private void chinaCHSToolStripMenuItem_Click_1(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e)
{
SetLanguageValue("LanguageType", "zh-CHS")
menuSChinese1.Checked = Janus.Windows.UI.InheritableBoolean.True
menuEnglish.Checked = Janus.Windows.UI.InheritableBoolean.False
menuTChinese.Checked = Janus.Windows.UI.InheritableBoolean.False
MessageBoxManager.Show("Please Re-Start OctO to view new Language!", "OctO-Change Language")
}
private void chinaTWToolStripMenuItem_Click_1(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e)
{
SetLanguageValue("LanguageType", "zh-TW")
menuSChinese1.Checked = Janus.Windows.UI.InheritableBoolean.False
menuEnglish.Checked = Janus.Windows.UI.InheritableBoolean.False
menuTChinese.Checked = Janus.Windows.UI.InheritableBoolean.True
MessageBoxManager.Show("Please Re-Start OctO to view new Language!", "OctO-Change Language")
}
#endregion
欢迎分享,转载请注明来源:夏雨云
评论列表(0条)