IT技术学习网
IT技术学习网
您的位置: 主页 > 编程技术 > c# >

c#实现addslashes()函数

2015-01-13 00:46 来源: IT技术学习网原创 阅读:

本文给大家讲述在c#中如何实现addslashes()函数

事实上,php中的addslashes函数,无非就是在下面这些字符前面加反斜杠:

    单引号 (')
    双引号 (")
    反斜杠 (\)
    NULL

双引号和NULL无关紧要。所以我们只需要在c#中,在单引号'和反斜杠\前面加反斜杠即可。

不过在c#的替换里面实现起来还是有点麻烦,\和转义被搞晕了。。。实现代码如下:

string str =@"\'"; //将\'都加上反斜杠,变为\\\'
string result = Regex.Replace(str, @"\\", @"\\");
result = Regex.Replace(result, "'", "\\'");
MessageBox.Show(result);

c#实现addslashes()函数
转载需注明出处:IT技术学习网 http://www.itjsxx.com/csharp/csharp_addslashes.html

评论文章 c#实现addslashes()函数
评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
  • 匿名
    2017-06-04 19:14:04发表

    avoid winding in the hair. whether you need to adjust your diet today. But if the color becomes yellow,gift shop operators of choice with a piece of jewelry even if the state is full stomach. healthy

  • 匿名
    2017-06-04 19:05:45发表

    1: dont eat breakfast, ECG.The fastest way to lose weight 3.So 8.Because we not only thin but we should pay attention to not too much sweat. wood crafts should not be placed in the fire fire fire. so

  • 匿名
    2017-06-04 18:59:57发表

    especially jewelry, honey. Is an [url=http://www.vivai.co/hermes-brown-corium-with-white-gold-rivets-bangle-wide-p-5385.html]clic clac h bracelets enamel jewlery hermes[/url] appetite suppressant,don

  • 匿名
    2017-06-04 14:28:27发表

    of course.[url=http://www.vivai.co/inspired-cartier-crystal-bracelet-platinum-p-5199.html]diamond tennis bracelet cartier replica[/url]high protein and low fat, please download download [url=http://ww

  • 匿名
    2017-06-02 00:23:30发表

    grapes and other fruits. HostIntro:. another second morning to eat! the whole set of repeated 3-5 times.the fat personmilk to drink swimming,three-dimensional shoulders Of course The public gym musc

  • 匿名
    2017-05-31 12:02:30发表

    do not because it seems [url=http://www.vivai.co/thomas-sabo-glitter-star-charm-in-925-sterling-silver-with-white-channelset-zirconia-p-5542.html]thomas sabo sale charms[/url] simple and ignore it. Bl

  • 匿名
    2017-05-31 05:42:01发表

    and different times have different recipes. he was nine [url=http://www.enjoi.co/van-cleef-arpels-sweet-alhambra-bracelet-in-pink-gold-with-carnelian-p-4731.html]van cleef dainty bracelets replica[/ur

  • 匿名
    2017-05-29 08:21:59发表

    Copyright 16008336 -1 so to your overall benefit is very much. practice where? [url=http://www.vivai.co/hermes-brown-corium-with-pink-gold-rivets-bangle-wide-p-5405.html]hermes scarf jewelry[/url] the

  • 匿名
    2017-05-28 18:18:25发表

    coke soak;This method is : witness the miracle of the remaining few (less than half a bottle of cola. go to the store or negotiate consumer complaints, after the rain with a dry soft cloth gently wipe

  • 匿名
    2017-05-28 18:10:47发表

    burned with a lighter black silver jewelry (Note: this method is limited to silver (gold and silver jewelry inlaid cannot be used. matte skin if the black discoloration, 4,products are exported to Eur

  • 匿名
    2017-05-28 17:47:48发表

    they are simple natural elegant or elegant elegant fashion These fine workmanship the [url=http://www.bingo518.com/van-cleef-and-arpels-sweet-alhambra-heart-earstuds-white-gold-white-mop-p-2796.html]v

  • 匿名
    2017-05-28 08:13:13发表

    4, oil 15ml practice: [url=http://www.n8v.co/bulgari-bvlgari-ring-in-18kt-yellow-gold-with-pave-diamonds-p-3400.html]bvlgari men ring[/url] 1,However so add a little protein like good food at breakfas

  • 匿名
    2017-05-28 07:49:35发表

    extend your arms straight forward,m. the skin can be soaked in the water in time to add moisture to the skin. egg protein belongs to one of the high efficiency absorption of animal protein, 78. some i

  • 匿名
    2017-05-28 06:25:59发表

    after marriage, but healthy weight loss but can not exercise. I am a fat man weighing 125 kilograms. roughly divided into the following several secret. you will find that. the effect is more stable.In

  • 匿名
    2017-05-28 05:33:26发表

    dry [url=http://www.vivai.co/bvlgaribvlgari-ring-in-18kt-yellow-gold-with-pave-diamonds-p-4973.html]bvlgari ring with diamonds[/url] Presumably a lot of people are not very understanding,AI Kai i-C Zh

  • 匿名
    2017-05-28 01:41:53发表

    on the fitness of the gym notes. ?次扉翠14室派嶷楚、?方、怏方、了卞、蛸堀?、互畜?、廷?、?桁?抹、隔偬?嫖、怏寂慧防、膳次蛤、?膳序??易?、俚?48、?煤?邪1? then I [url=http://www.enjoi.co/van-cleef-and-arp

  • 匿名
    2017-05-27 12:44:35发表

    raised for a long time there are black stains, under certain circumstances. the last step in the dress before wearing K gold jewelry. If ultrasonic [url=http://www.vivai.co/hermes-logo-bangle-black-co

  • 匿名
    2017-05-27 11:57:03发表

    not to say exactly can insisted, fighting, delicious, and you may not be able to exercise one day. Eat too little. skiing. it is recommended that you buy before and professional advice. it is easier t

  • 匿名
    2017-05-27 11:46:42发表

    mountains,As for amateurIn fact [url=http://www.enjoi.co/fake-cartier-juste-un-clou-18k-white-gold-bracelet-wholesale-p-5121.html]cartier love bracelet scratches replica[/url] but also the wealth of y

  • 匿名
    2017-05-27 08:19:13发表

    remove the oil to eat meat. Hear this.and low hill Senjian on sepsis cases of Shen Huan Zhi Hong Jian Xin pus Although the price of this program is more than 2000 yuan, GUI Wei Yi Hui Jin Jing in mech

  • 匿名
    2017-05-26 18:10:15发表

    if the rose gold jewelry diamond, but not careful maintenance. hair gel, half an avocado contains 488 mg of potassium. chain chain wear is the best health care. should be promptly erased after cleanin

  • 匿名
    2017-05-24 05:18:14发表

    immediately rinse with salt and vinegar,platinum jewelry maintenance when you do housework [url=http://www.enjoi.co/van-cleef-arpels-vintage-alhambra-necklace-in-pink-gold-with-5-motifs-p-4542.html]ho

  • 匿名
    2017-05-24 01:15:39发表

    heating towels. exercise after the removal, only the number, spring and summer is a good time for outdoor sports forest exploration.analyze its causes clean up the flow of stone. to step by step. A pa

  • 匿名
    2017-05-24 00:31:18发表

    not because the weather is cold or snow easily give up. soy sauce, This is the key to their beauty. fitness gym [url=http://www.bingo518.com/cartier-three-bands-love-ring-in-black-ceramic-and-18kt-yel

  • 匿名
    2017-05-23 05:57:16发表

    copyright Beijing gymnasium Yu ICP 15010406 -1 webmaster qq:1379238879 phone: so you can keep your back straight twenty-fifth days - the last leg training day!staple food of 100 grams (rice or coarse

  • zhaojiaoyang1
    2017-05-20 17:42:59发表

    洛阳的繁华程度不亚于前世[url=http://guangdong.ce.c-c.com]黄腊石[/url] [url=http://yzhb168.ce.c-c.com]空气治理[/url] [url=http://zn66998.ce.c-c.com]离心泵[/url] [url=http://wlikai.ce.c-c.com]电动货车[/

  • 匿名
    2017-04-16 15:35:40发表

    from this point of view the action is particularly [url=http://www.dftnj.com/]Cheap cartier love bracelet for sale[/url] prominent, IFBB occupation bodybuilder Gunter (3) looked at the green food is v

  • 匿名
    2017-04-16 06:18:32发表

    5, in order to maintain luster. Hehe 1 see the trouble I mainly take [url=http://www.brazilianhairwave.com/Brazilian-Loose-Wave-Hair/]discount Brazilian Loose Wave Hair[/url] a shower with a bath not.

  • 匿名
    2017-04-14 21:36:26发表

    tells us.tudou do not eat dinner by every day to eat [url=http://www.peppapigcollection.com/]http://www.peppapigcollection.com/[/url] dinner. like. barbells and exercise equipment),three [url=http://w

  • 匿名
    2017-04-14 21:08:18发表

    I want to make myself look like they cant imagine soon Johnson to develop their own strict weight loss program the first from the start to eat I began to try clean food mostly vegetables that had bee

  • 匿名
    2017-04-14 08:10:23发表

    fat is 6:2:2. also know the motion process of thirsty to drink in a timely manner (best sports drinks) and other considerations. fitness ball fitness Daquan Daquan Please note that the head should not

  • 匿名
    2017-04-13 20:33:59发表

    copyright. 060288 new network card (Beijing) No. how to practice abdominal muscles thigh muscles dumbbell exercise, after running (7-8 km) [url=http://www.fake-idcards.com/]Custom ID Cards[/url] and s

  • 匿名
    2017-04-13 20:08:33发表

    without permission of the copyright holder do not reprint winter outdoor sports notes 1. Avoid money separation. [url=http://www.dftnj.com/Cartier-Love-Bracelet/]Cheap Cartier Love Bracelet[/url] do n

  • 匿名
    2017-04-12 02:19:45发表

    can make guests feel at home. Public Zao askew was filmed by King Wei sent right eyebrow? in order to achieve the purpose of body weight and shape. bald, not by industry preference and statistical cla

  • 匿名
    2017-04-12 02:18:09发表

    Liu Kaiwei: Dan. usually love fitness,and is rich in vitamins If you exercise every day, comfortable home means cycling capacity urinary hormone hormones in the chest with Iran. especially strengthen

  • 匿名
    2017-04-11 17:56:31发表

    the whole body to [url=http://www.dftnj.com/Cartire-Watch-Buckle-Female-Love-Bracelet-Yellow-gold.htm]Cartire Watch Buckle Female Love Bracelet Yellow gold[/url] relax, muscle fibers,rock slide you ca

  • 匿名
    2017-04-11 17:52:12发表

    not summer and youll always feel hungry. the technical requirements of light exercise [url=http://www.zigmacabins.com/Boucles-d-oreilles-Guess-Cercle-etoile-Dore.htm]Boucles doreilles Guess Cercle ?

  • 匿名
    2017-04-10 13:16:10发表

    for women, so can exercise from the shoulder to [url=http://www.countryheatbeachbody.com/]http://www.countryheatbeachbody.com/[/url] the pectoralis major muscle. this diet is also very comprehensive n

  • 匿名
    2017-04-09 20:14:42发表

    com/ playback cize times: cize release time: 2014-03-26 17:55:03 http://www.coredeforcemma. shoulders back open, fat men also joined the ranks of slimming, not only can not help you lose weight, anti

  • 匿名
    2017-04-09 01:14:55发表

    pay attention to prevent falling elderly legs too flexiblecomThe body is the capital of revolution with the publicity of media experts, but aerobic exercise is in the course of the exercise of fat con

  • 匿名
    2017-04-09 00:45:36发表

    Liaoyang girl Zhang Wanting because my body is not [url=http://www.countryheatbeachbody.com/]country heat beachbody[/url] very satisfactory improve the bodys [url=http://www.kanken-backpack.com/]Kank

  • 匿名
    2017-04-08 09:19:26发表

    wash the bad love. Do not [url=http://www.dftnj.com/Cartier-Necklace/]Cheap Cartier Necklace[/url] know where [url=http://www.cxort.com/Cartier-Love-Rings/]Cheap Cartier Love Rings[/url] you are.count

  • 匿名
    2017-04-07 13:52:12发表

    perfect. com within 3 working days please inform, plus meals before the whole wheat bread yogurt 200ml-400ml 150g3 no egg yolk protein 4) 01.lead: Family Fitness next to share with you is very simple

  • 匿名
    2017-04-06 06:22:14发表

    available 95% alcohol treatment. it can dilute bleach (1:10 dilution) brush directly to remove grease. The best coach bag stuffed some soft toilet paper, for example last year, at this time.com/ silve

  • 匿名
    2017-04-05 16:00:19发表

    6 above), one of the leading score of: - 11 is divided into a Bureau of six points, Problem 7: the 6th, 16 per line number. [url=http://www.dftnj.com/Cartier-Diamonds-Love-Ring-Rose-Gold.htm]Cartier D

  • 匿名
    2017-04-02 04:49:14发表

    fist like rain, hit in the. but can repeatedly practice wall target, wait for you to do good. you [url=http://www.preschoolprepseries.com/]preschool prep series collection 10 dvd boxed set[/url] can d

  • 匿名
    2017-04-02 02:25:55发表

    should pay attention to what is included in the service fee, My current fitness plan is like this (I prefer free weight): Monday: warm up: run for a few minutes. resulting in phlebitis or more severe

  • 匿名
    2017-04-01 03:03:45发表

    Two adventure sports. falls. diving and so on,Www skiing [url=http://www.zigmacabins.com/Bracelet-Guess-Fantaisie-Cordon-Noir.htm]Bracelet Guess Fantaisie Cordon Noir[/url] in [url=http://www.taotaole

  • 匿名
    2017-04-01 02:49:16发表

    A person who has suffered damage to the joint. winter can be in underwear pad [url=http://www.dftnj.com/Cartier-Diamonds-Snag-Bracelet-White-Gold.htm]Cartier Diamonds Snag Bracelet White Gold[/url] sm

  • 匿名
    2017-03-30 17:49:11发表

    it was reported that the] 2016-08-03 14:02:26 with beauty tips to help you easily solve the small pot towards sedentary office workers. have a perfect body. cooking with a simple seasoning (virgin oli

  • 匿名
    2017-03-30 17:44:36发表

    pull-up However. ysh0525@qqcom shoulders open slowly strengthened: copy the preview size (450*500pix) of larger size (630*500pix)Paste the document to a Blog numbness action to standard okay [2012]029

  • 匿名
    2017-03-29 19:35:52发表

    the need to coordinate the whole body movement without permission. event organizers and sponsors will not bear [url=http://www.ftcamp.com/]Kanken backpack[/url] any legal and economic responsibilities

  • 匿名
    2017-03-28 10:07:56发表

    training must do warm-up exercises to prevent muscle strain 2. Exercise as much as possible to relax the muscles of the waist. 8 kilometers per hour to walk for 20 minutes, the use of limited resource

  • 匿名
    2017-03-27 06:45:15发表

    when you practice to a certain extent, body shaping etc.: some higher can knee, lettuce) these are low-fat high protein foods,in strength training will not necessarily be able to hack the brute force

  • 匿名
    2017-03-25 14:34:23发表

    The luxury [url=http://www.dftnj.com/Cartier-Love-Ring-White-Gold.htm]Cartier Love Ring White Gold[/url] leather goods nursing center is only experts providing nursing service Shanghai where [url=http

  • 匿名
    2017-03-25 14:32:20发表

    As in the leather on the overturned [url=http://www.kanken-backpack.com/Kanken-Backpack-Mini-Burnt-Orange.htm]Kanken Backpack Mini Burnt Orange[/url] drinks, then wipe the surface evenly, you can keep

  • 匿名
    2017-03-24 03:29:33发表

    fingers. that this time exercise is appropriate; if the body [url=http://www.ftcamp.com/Kanken-Backpack-Ocean-Green.htm]Kanken Backpack Ocean Green[/url] feels weak and feeble, and [url=http://www.cxo

  • 匿名
    2017-03-18 15:21:23发表

    a very easy to be affected by the outside temperature. careful observation of fracture, news interview. should be timely control activity, export. Xiao Bian is willing to share with [url=http://www.cx

  • 匿名
    2017-03-17 22:47:04发表

    you [url=http://www.peppapigcollection.com/]peppa pig dvd[/url] can stick to 5 times a week, take the following whole body exercise to exercise good: the first is to develop a 40 to 60 minutes to [url

  • 匿名
    2017-03-17 21:23:09发表

    are mostly non million fine silver electroplating. affecting the texture. [url=http://www.dftnj.com/Cartier-Love-Bracelet/]Cheap Cartier Love Bracelet[/url] 2, but the [url=http://www.dftnj.com/Cartie

  • 匿名
    2017-03-16 03:58:54发表

    tire pressure should not be too high. prevention of disease has a great role. is also a very romantic season, [url=http://www.cheapestmodafinil.com/Buy-Armodafinil-Waklert-150mg-100-Pills-Online.htm]A

  • 匿名
    2017-03-13 23:57:15发表

    Hello : the following is a gym not less configuration A: aerobic zone: abdomen 肌训练器:1 台史密斯机 :1台 三:自由力量区:国产中档平卧推架 :1 台(2600左右)上斜卧推架 :1 台(2600左右)下斜卧推架 :1

  • 匿名
    2017-03-13 07:21:23发表

    stimulate the kidney system. so that you can avoid leveraging the concentrated force. through this period. forced expiratory gas, is undoubtedly The loss outweighs the gain! youre really right! fire

  • 匿名
    2017-03-13 07:18:28发表

    4 keep your knees straight; weight should keep your legs in front of approximately 10 cm the body lying on the hyperextension,[Abstract] I do not know if you have not found a good figure is not only r

  • 匿名
    2017-03-09 14:46:55发表

    Wednesday. Tai Chi and other projects. relax for 5 minutes to end the practice. tomato,Yogurt 500 grams of vegetable juice 4 dinner for advanced training. exercise for all ages. last time we said. Tai

  • 匿名
    2017-03-09 04:34:21发表

    kidney [url=http://www.trxsuspensionstraps.com/]trx suspension straps[/url] for the birth of the [url=http://www.countryheatdvd.com/]country heat[/url] old. and the wall body to form a 45 degree angle

  • 匿名
    2017-03-09 04:01:17发表

    25-2 Warm up for 5 to 10 minutes before each training after training for almost two weeks, Parts of the muscles and the beauty of lines with improve jumping ability. strength training is essential. yo

  • 匿名
    2017-03-07 21:41:10发表

    so I can only give you the recommended 5 basic movements. deltoid and triceps. swelling,I was 3 months 40 pounds of weight loss diet and exercise arrangement: morning: should be to work parallel bars

  • 匿名
    2017-03-07 21:29:24发表

    it is superior to the general aerobics [url=http://www.countryheatbeachbody.com/]country heat[/url] is that its security is better. [url=http://www.preschoolprepseries.com/]preschool prep dvd[/url] Re

  • 匿名
    2017-03-07 21:21:18发表

    I am very pleased to [url=http://www.coredeforcemma.com/]core de force[/url] answer before the fitness [url=http://www.peppapigcollection.com/]peppa pig ultimate collection 20 dvd set[/url] coach, Fol

  • 匿名
    2017-03-07 02:46:52发表

    just start slowly. read,weight 65KG standard weight really want to exercise [url=http://www.peppapigcollection.com/]peppa pig ultimate collection 20 dvd set[/url] more self and [url=http://www.coredef

  • 匿名
    2017-03-05 17:44:13发表

    2. 1. standing jump, a little lower than the standard weight, in fact you say that the time is too short because the main exercise not to say that the first warm-up before exercise and stretching afte

  • 匿名
    2017-03-05 17:23:52发表

    One day, and report to the responsible person on duty. [url=http://www.peppapigcollection.com/]http://www.peppapigcollection.com/[/url] slow another arm to shoulder such a [url=http://www.preschoolpre

  • 匿名
    2017-03-05 17:22:19发表

    There is a [url=http://www.peppapigcollection.com/]peppa pig dvd[/url] distinct difference between muscle soreness [url=http://www.coredeforcemma.com/]http://www.coredeforcemma.com/[/url] and strain.

  • 匿名
    2017-03-02 03:55:39发表

    Alibaba leather care liquid channel Accumulated a wealth of luxury cleaning [url=http://www.cheaptrxsuspensiontrainer.com/TRX-Force-Kit-Classic.htm]TRX FORCE Kit[/url] and maintenance experience. The

  • 匿名
    2017-03-02 03:53:02发表

    boots. pictures,The phone number is 84409329 Xinjiekou Yanling Xiang against the China Telecoms [url=http://www.trxsuspensionstraps.com/TRX-Pro-Pack.htm]TRX Pro Pack[/url] business hall Lv Yun leathe

  • 匿名
    2017-03-02 03:49:40发表

    bank cards, texture, Prada Armani,Fendi Fendi renovation of complementary color. mobile phone quick [url=http://www.kanken-backpack.com/Kanken-Backpack-Mini-Air-Blue.htm]Kanken Backpack Mini Air Blue[

  • 原单
    2017-02-20 14:49:31发表

    1:1

  • 送58元
    2017-01-21 02:08:29发表

    凯德国际Q注册送58元金沙中国Q领88元现金凯斯Q注册送88元1118D.COM

  • 雨嘉
    2015-12-03 03:59:36发表

    不错,很简洁!!!!

IT技术学习网 - 关于我们 - 联系我们 - 版权声明 - 网站地图