帮助我有关Visual Studio 2008中的查找和替换选项 [英] Help me regarding find and replace option in Visual Studio 2008

查看:88
本文介绍了帮助我有关Visual Studio 2008中的查找和替换选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过以下方式在多个asp .net CS文件中有一个页面加载事件

I have a single page load event in multiple asp .net CS files in the following manner

protected void Page_Load(object sender, EventArgs e)
        {
            if (CheckLoginStatus.Check(this))
            {
                VisitorSection.InnerHtml = "";
            }
            else
            {
                MemberSection.InnerHtml = "";
            }
        }




现在我要替换以下行




Now I want to replace the following line

VisitorSection.InnerHtml = "";



通过这两行



With these two lines

VisitorSection.InnerHtml = "";
WelcomeName.InnerText = Session["UserName"].ToString();




您可能知道,查找和替换选项仅允许替换单行,我该如何处理上述情况?


在此先感谢您的帮助..




As you might know that find and replace option only allows single line to be replaced, how can I deal with above scenario?


Thanks in Advance for help..

推荐答案

棘手的问题-正则表达式就是答案:

按Ctrl + Shift + F
在查找内容"中输入"VisitorSection.InnerHtml ="; Eneter''替换为''
中的''VisitorSection.InnerHtml ="; \ nWelcomeName.InnerText = Session ["UserName"].ToString();'' 转到查找选项->勾选使用->选择正则表达式

\ n用于分隔行
Tricky question - Regular expressions is the answer:

Press Ctrl+Shift+F
Enter ''VisitorSection.InnerHtml = "";'' in ''find what''
Eneter ''VisitorSection.InnerHtml = "";\nWelcomeName.InnerText = Session["UserName"].ToString();'' in ''Replace with''
Go to Find options-->Tick Use-->Select Regular expressions

''\n'' is used to seperate lines


这篇关于帮助我有关Visual Studio 2008中的查找和替换选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆