教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 精品文档 > 政务民生 >

模仿csdn的代码,己整理的Linux常用命令(5)

来源:网络收集 时间:2026-07-24
导读: //要替换的敏感字 string SqlStr = @\r|char|asc|mid|substring|master|truncate|declare|xp_cmdshell|restore|backup|net +user|net +localgroup +administrators\ try { if ((inputString != null) (inputString

//要替换的敏感字 string SqlStr =

@\r|char|asc|mid|substring|master|truncate|declare|xp_cmdshell|restore|backup|net +user|net +localgroup +administrators\ try {

if ((inputString != null) && (inputString != String.Empty)) {

string str_Regex = @\

Regex Regex = new Regex(str_Regex, RegexOptions.IgnoreCase); //string s = Regex.Match(inputString).Value;

MatchCollection matches = Regex.Matches(inputString); for (int i = 0; i < matches.Count; i++)

inputString = inputString.Replace(matches[i].Value, \matches[i].Value + \

} } catch {

return \ }

return inputString; } ///

/// 将已经替换成的\敏感字]\,转换回来为\敏感字\/// /// ///

public string MyDecodeOutputString(string outputstring) {

//要替换的敏感字 string SqlStr =

@\r|char|asc|mid|substring|master|truncate|declare|xp_cmdshell|restore|backup|net +user|net +localgroup +administrators\ try {

if ((outputstring != null) && (outputstring != String.Empty)) {

string str_Regex = @\

Regex Regex = new Regex(str_Regex, RegexOptions.IgnoreCase); MatchCollection matches = Regex.Matches(outputstring); for (int i = 0; i < matches.Count; i++)

outputstring = outputstring.Replace(matches[i].Value, matches[i].Value.Substring(1, matches[i].Value.Length - 2));

} } catch {

return \ }

return outputstring; }

#endregion

void CAngle::drawInfo(QPainter &Pt) {

QPoint midPt = ((m_ptArray[1] + m_ptArray[2]))/2; QString str_angle;

QString str_1 = \ QString str_2 = \ QFont myFont;

QFontMetrics fm(myFont);

qDebug() << __func__ <<\ int width = 0; int width1 = 0; int heigh = 0;

double x1 = m_ptArray[0].x()-m_ptArrayx(); double y1 = m_ptArray[0].y()-m_ptArrayy(); double x2 = m_ptArrayx()-m_ptArrayx(); double y2 = m_ptArrayy()-m_ptArrayy(); double x = x1*x2 + y1*y2; double y = x1*y2 - x2*y1;

angle = 180 / (M_PI /acos(x / (sqrt(pow(x,2) + pow(y,2)))));

str_angle.setNum(angle); width = fm.width(str_angle); width1 = fm.width(str_2); heigh = fm.height() * 3;

QRect rectinfo(midPt.x(),midPt.y(),width + width1,heigh); Pt.setPen(ang_info_pen);

Pt.drawRoundedRect(rectinfo,5,5);

Pt.drawText(rectinfo,Qt::AlignCenter,QString(\\ }

void CAngle::mousePressEvent(QMouseEvent *event) {

switch(countClick){ case 0: {

m_ptArray.push_back(event->pos()); m_ptArray.push_back(event->pos()); m_ptArray.push_back(event->pos()); countClick++;

CDrawWin::m_curDrawStatus = CDrawWin::DRAW_STATUS_DRAWING; }

break; case 1: {

m_ptArray[1] = event->pos(); countClick++;

CDrawWin::m_curDrawStatus = CDrawWin::DRAW_STATUS_DRAWING; }

break;

…… 此处隐藏:255字,全部文档内容请下载后查看。喜欢就下载吧 ……
模仿csdn的代码,己整理的Linux常用命令(5).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wendang/447914.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)