Recommandé: Résumé de 11 syntaxes de base de données pour la connexion ASP Les opérations liées aux bases de données sont souvent utilisées. Il inclut les codes de connexion, les commandes SQL, etc., mais je ne m'en suis jamais délibérément souvenu (je ne veux pas me souvenir de cette chose), donc je vérifie souvent les livres et je les parles lorsque je les utilise. Certaines bases de données moins utilisées peuvent ne pas être en mesure de se dérouler en douceur
Cette fois, j'ai mis à jour le programme de blog que j'utilisais, en utilisant le Pinyin du titre de l'article lors de la génération de fichiers statiques. Cela implique comment convertir le texte en pinyin. J'ai jeté un coup d'œil en ligne. La même fonction ne doit être normale que sous GB2312, et je n'y ai pas beaucoup pensé. Cela montre un paragraphe que j'ai vu dans le code source du système sans souci et que je l'ai utilisé.
Jetons un coup d'œil aux fonctions suivantes et ajoutons quelques commentaires:
Ceci est une fonction qui personnalise les mots spéciaux
| Ce qui suit est le contenu cité: Fonction getEnglish (byval str) getEnglish = str getEnglish = Remplacer (GetEnglish, Chine, Chine) getEnglish = remplacer (getEnglish, planifier, plan) getEnglish = remplacer (getenglish, gratuit, gratuit) getEnglish = remplacer (getEnglish, introduction, intro) getEnglish = remplacer (getEnglish, compétence, compétence) getEnglish = remplacer (getEnglish, vie, vie) getEnglish = remplacer (getEnglish, activité, activité) getEnglish = remplacer (getEnglish, outil, outil) getEnglish = remplacer (getEnglish, alliance, union) getEnglish = remplacer (getEnglish, inscription, inscription) getEnglish = remplacer (getEnglish, expérience, expérience) getEnglish = remplacer (getEnglish, traduction, traduire) getEnglish = remplacer (getEnglish, projet, article) getEnglish = remplacer (getEnglish, site Web, site Web) getEnglish = remplacer (getEnglish, anglais, anglais) getEnglish = remplacer (getEnglish, anglais, anglais) getEnglish = remplacer (getEnglish, yahoo, yahoo) getEnglish = remplacer (getEnglish, Sina, Sina) getEnglish = remplacer (getEnglish, Alipay, Alipay) getEnglish = remplacer (getEnglish, transaction, commerce) getEnglish = remplacer (getEnglish, boutique en ligne, B2C) getEnglish = remplacer (getEnglish, mettre à niveau, mettre à jour) getEnglish = remplacer (getEnglish, magazine, magazine) getEnglish = remplacer (getEnglish, espace, espace) getEnglish = remplacer (getEnglish, amour, amour) getEnglish = remplacer (getEnglish, ami, ami) getEnglish = remplacer (getEnglish, amitié, ami) getEnglish = remplacer (getEnglish, lien, comme) getEnglish = remplacer (getEnglish, étiquette, étiquette) getEnglish = remplacer (getEnglish, courir, courir) getEnglish = remplacer (getEnglish, gestion, manager) getEnglish = remplacer (getEnglish, gestion, gérer) getEnglish = remplacer (getEnglish, page, page) getEnglish = remplacer (getEnglish, modèle, modèle) getEnglish = remplacer (getEnglish, jeu, jeu) getEnglish = remplacer (getEnglish, forum, forum) getEnglish = remplacer (getEnglish, nouvelles, nouvelles) getEnglish = remplacer (getEnglish, musique, musique) getEnglish = remplacer (getEnglish, aider, aider) getEnglish = remplacer (getEnglish, optimisation, optimiser) getEnglish = remplacer (getEnglish, logiciel, doux) getEnglish = remplacer (getEnglish, tutoriel, technologie) getEnglish = remplacer (getEnglish, télécharger, télécharger) getEnglish = remplacer (getEnglish, rechercher, rechercher) getEnglish = remplacer (getEnglish, moteur, moteur) getEnglish = remplacer (getEnglish, araignée, araignée) getEnglish = remplacer (getEnglish, journal, journal) getEnglish = remplacer (getEnglish, blog, blog) getEnglish = remplacer (getEnglish, baidu, baidu) getEnglish = remplacer (getEnglish, google, google) getEnglish = remplacer (getEnglish, boîte aux lettres, boîte aux lettres) getEnglish = remplacer (getEnglish, courrier, courrier) getEnglish = remplacer (getEnglish, nom de domaine, domaine) getEnglish = remplacer (getEnglish, tester, tester) getEnglish = remplacer (getEnglish, démo, démo) getEnglish = remplacer (getEnglish, musique, musique) getEnglish = remplacer (getenglish, blague, blague) getEnglish = remplacer (getEnglish, produit, produit) getEnglish = remplacer (getEnglish, message, message) getEnglish = remplacer (getEnglish, commentaires, libération en arrière) getEnglish = remplacer (getEnglish, commentaire, commentaire) getEnglish = remplacer (getEnglish, recommandé, commentaire) getEnglish = remplacer (getEnglish, partager, partager) getEnglish = remplacer (getEnglish, ressource, ressource) getEnglish = remplacer (getEnglish, plugins, plugins) getEnglish = remplacer (getEnglish, cahier, cahier) getEnglish = remplacer (getEnglish, ordinateur, ordinateur) getEnglish = remplacer (getEnglish, système, système) getEnglish = remplacer (getEnglish, école, école) getEnglish = remplacer (getEnglish, sans souci, 5U) getEnglish = remplacer (getEnglish, job, travail) getEnglish = remplacer (getEnglish, informations, info) getEnglish = remplacer (getEnglish, divertissement, ent) getEnglish = remplacer (getEnglish, voiture, voiture) getEnglish = remplacer (getEnglish, mobile, mobile) getEnglish = remplacer (getEnglish, réseau, réseau) getEnglish = remplacer (getEnglish, boss, boss) getEnglish = remplacer (getenglish, chien, chien) getEnglish = remplacer (getEnglish, télévision, télévision) getEnglish = remplacer (getEnglish, film, film) Fonction finale |
Ensuite, il y a la fonction la plus critique pinyin (byval chinois) qui convertit le chinois en pinyin
| Ce qui suit est le contenu cité: fonction pinyin (byval chinois) Chinois = remplacer (chinois, /,): chinois = remplacer (chinois, /,) Chinois = remplacer (chinois, *,): chinois = remplacer (chinois,],) Chinois = remplacer (chinois, [,): chinois = remplacer (chinois,},) Chinois = remplacer (chinois, {,): chinois = remplacer (chinois, ',) Chinois = GetEnglish (chinois) 'avec Getenglish ici, convertissez d'abord les mots spéciaux Dim pinyinstr, iSr, iiscn, iscn Dim PinyinCN, RS, I, X 'Ouvrez la bibliothèque Pinyin ici «Vous pouvez également intégrer la bibliothèque Pinyin dans votre base de données de programme. sur l'erreur reprendre ensuite Définir PinyInCon = Server.CreateObject (ADODB.Connection) PinyInCon.Open Provider = Microsoft.Jet.oledb.4.0; Data Source = & Server.Mappath (Pinyin.asp) Si err, alors pinyin =: définissez PinyinCN = rien: fonction de sortie Iscn = true pour i = 1 à Len (chinois) iiscn = iscn 'obtenir la valeur de savoir s'il s'agissait du dernier chinois ISR = Mid (chinois, i, 1) x = asc (isttr) if (x> = 65 et x <= 90) ou (x> = 97 et x <= 122) ou (x> = 48 et x <= 57) ou isr = alors Iscn = false 'ce sont l'anglais, les nombres (caractères réservés), sans changer Si iTr = alors iTr = - autre set rs = pinyinconn.execute (sélectionnez le top 1 [pinyin] à partir de [pinyin] où [contenu] comme '% & isr &%';) Si ce n'est pas Rs.Eof alors ISR = LCase (RS (0)): ISCN = VRAI 'Chinois autre Iscn = false Si iTr = alors iTr = - else itr = 'convertit les espaces en -, effacez-le s'il s'agit d'un autre caractère terminer si Rs.Close: Set rs = rien terminer si Si iiscn = iscn alors pinyinstr = pinyinstr & isr else pinyinstr = pinyinstr & - & isr pinyinstr = remplacer (pinyinstr, -, -) pinyinstr = remplacer (pinyinstr, __, _) suivant Si droit (pinyinstr, 1) = - puis pinyinstr = gauche (pinyinstr, len (pinyinstr) - 1) Si droit (pinyinstr, 1) = _ alors pinyinstr = gauche (pinyinstr, len (pinyinstr) - 1) Si gauche (pinyinstr, 1) = - puis pinyinstr = droite (pinyinstr, len (pinyinstr) - 1) Si gauche (pinyinstr, 1) = _ alors pinyinstr = droite (pinyinstr, len (pinyinstr) - 1) pinyinconn.close Définir PinyInCon = Rien pinyin = trim (pinyinstr) fonction finale |
Comment utiliser:
| Ce qui suit est le contenu cité: Response.Write Pinyin (Bonjour, bienvenue en Chine!) |
Cette méthode est convertie en nom de fichier de format Pinyin très convivial. Xiaocheng qui a des exigences pour le référencement peut l'essayer.
Partager: Introduction à ASP et à cinq objets intégrés Tableau 1. ASP Basics 2. Cinq objets majeurs d'ASP 3. Objet de demande 4. Objet de réponse 5. Objet serveur 6. Objet d'application 7. Objet de session 1. ASP Basics Microsoft Active Server Pages, que les lecteurs et les amis l'appellent