Multilingual version test

xiaoxiao2021-04-05  243

Public static string getlanguage (int filetype, string key) // fileType divided by two: users, admin {int Cache = 0; // 1 = Open Cache String path = "language / zh-cn / user.xml"; if (FileType == 1) // Administrator {path = "language / zH-cn / admin.xml";} Object o = null; hashtable hash = new hashtable (); if (system.web.httpContext.current.cache [path] == null || cache == 0) // Never load {xmldocument d = new xmldocument (); D.Load (System.Web.httpContext.current.server.mAppath (PATH)); Foreach XMLNode XN in D.selectsinglenode ("root"). ChildNodes) {if (xn.nodetype! = Xmlnodetype.comment) Hash.Add (xn.attributes ["name"]. Value, xn.innertext);} o = hash System.Web.httpContext.current.cache.insert (Path, O);} else {o = system.Web.httpContext.current.cache.get (path);}

// ------------------------------------ha = (Hashtable) O; IF ( Hash.contains (key)) {Return hash [key] .tostring ();} return null;}

list tree-> 1 2 3 4 5 six seven eight 9 < Resource name = "10"> 10 Login Exit Register Search Help Home Browse class To send your hand My desk < / Resource> Customer service center Welcome Welcome

转载请注明原文地址:https://www.9cbs.com/read-131995.html

New Post(0)