Unity【GUI】基础知识

什么是UI系统

Ul是UserInterface(用户界面)的简称

系统的主要学习内容

1.UI控件的使用
2.U控件的事件响应 
3.U的分辨率自适应

文章目录

  • 基础知识
    • 1、工作原理和主要作用
    • 2、基本控件
      • 1、文本和按钮控件
      • 2、多选框和单选框
      • 3、输入框和拖动条
      • 4、图片绘制和框
    • 3、复合控件
      • 1、工具栏和选择网格
      • 2、滚动视图和分组
      • 3、窗口相关
    • 4、自定义整体样式
      • 1、GUIskin
      • 2、GUILayout
  • 实践小项目
    • 1、需求分析
    • 2、九宫格布局概念
    • 3、控件位置信息类
    • 4、控件父类
    • 5、父对象控制绘制顺序
    • 6、自定义常用控件
      • 1、自定义文本和按钮
      • 2、自定义多选框
      • 3、自定义多选框控件(单选)
      • 4、自定义输入框和拖动条
      • 5、自定义图片绘制

基础知识

1、工作原理和主要作用

1、GUI概念

即时模式游戏用户交互界面(IMGUI)
在Unity简称GUI
它是一个代码驱动的UI系统

2、GUI作用

1,作为程员的调试,创建游戏内调试身
2.为脚本组件创建自定义检视面板
3.创建新的编辑器窗口和工具以拓展Unity本身(一般用作内置游戏工具)

3、GUI的工作原理

在继承MonoBehaviour的脚本中的特殊函数里
调用GUI提供的方法,类似生命周期函数private void OnGUI(){//在其中书写GUI相关代码即可显示GUI内容}
注意:1.它每顿热行相当于是用于专门绘制GUI界面的函数2:一般只在其中执行GUI相关界面绘制和操作逻辑3.该函数在【OnDisable】之前【LateUpdate】之后执行4.只要是继承Mono的脚本都可以在OnGUI中绘制GUI

2、基本控件

在这里插入图片描述

1、文本和按钮控件

1、GUI控件绘制的共同点

1.他们都是GUI公共类中提供的静态函数,直接调用即可
2.他们的参数都大同小异位置参数:Rect参数 x y位置 w h尺寸显示文本:string参数图片信息:Texture参数综合信息:GUIContent参数自定义样式:GUIStyle参数
3.每一种控件都有多种重载,都是各个参数的排列组合必备的参数内容是【位置信息】和【显示信息】

2、文本控件

public Rect rect; //位置
public Texture text; //图片
public GUIContent content; //综合使用
public GUIStyle style; //自定义样式private void OnGUI()
{1、基本使用GUI.Label(new Rect(0, 0, 100, 20), "文本控件");GUI.Label(rect, text);2、综合使用 (左图,右文字)GUI.Label(rect, content);3、获取GUI控件对应的信息Debug.Log(GUI.tooltip);4、自定义样式GUI.Label(new Rect(0, 0, 100, 20), "文本控件", style);字体路径 C:\Windows\Fonts
}

3、按钮控件

public Rect btnRect;
public GUIContent btnContent;
public GUIStyle btnStyle;private void OnGUI()
{if(GUI.Button(btnRect, btnContent, btnStyle))//Button 按下抬起算一次点击//RepeatButton 长按,一直返回true{Debug.Log("按钮被点击");}
}

2、多选框和单选框

1、多选框

普通样式private bool isSel;private void OnGUI(){isSel = GUI.Toggle(new Rect(0, 0, 100, 30), isSel, "效果开关");}自定义样式修改固定宽高 fixedWidth 和 fixedHeight修改从GUIStyle边缘到内容起始处的空间 padding

2、单选框

private int nowSelIndex = 1;private void OnGUI()
{//Toggle点击后返回trueif(GUI.Toggle(new Rect(0, 100, 100, 20), nowSelIndex == 1, "选项一"))nowSelIndex = 1;if (GUI.Toggle(new Rect(0, 140, 100, 20), nowSelIndex == 2, "选项二"))nowSelIndex = 2;if (GUI.Toggle(new Rect(0, 180, 100, 20), nowSelIndex == 3, "选项三"))nowSelIndex = 3;
}

3、输入框和拖动条

1、输入框

普通输入private string inputStr;private void OnGUI(){//5为最大输入长度inputStr = GUI.TextField(new Rect(0, 0, 100, 30), inputStr,5);}
密码输入private string inputPW;private void OnGUI(){inputPW = GUI.PasswordField(new Rect(0, 0, 100, 30), inputPW, '*');}

2、拖动条

水平拖动条private float nowValue = 0.5f;private void OnGUI(){nowValue = GUI.HorizontalSlider(new Rect(0, 100, 100, 50), nowValue, 0, 1);}
竖直拖动条nowValue = GUI.VerticalSlider(new Rect(0, 150, 50, 100), nowValue, 0, 1);

4、图片绘制和框

1、图片绘制

public Rect texPos;
public Texture tex;
public ScaleMode mode; //显示模式//ScaleAndCrop: 通过宽高裁剪//ScaleToFit: 缩放不会变形//ScaleToFill: 填充满宽高(默认)
public bool alpha; //背景是否透明
private void OnGUI()
{GUi.DrawTexture(texPos, tex, mode, alpha);
}

2、框绘制

GUI.Box(texPos, "");

3、复合控件

在这里插入图片描述

1、工具栏和选择网格

1、工具栏

private int toolbarIndex = 0;
private string[] toolbarInfos = new string[] { "选项一", "选项二", "选项三" };private void OnGUI()
{toolbarIndex = GUI.Toolbar(new Rect(0, 0, 200, 30), toolbarIndex, toolbarInfos);
}
private void DrawWindow(int id)
{switch (id){case 1:GUI.Button(new Rect(0, 30, 30, 20), "按钮1");break;case 2:GUI.Button(new Rect(0, 30, 30, 20), "按钮2");break;case 3:GUI.DragWindow();break;} 
}

2、选择网格

private int selGridIndex = 0;
private void OnGUI()
{//xCount 水平方向最多显示数量,超过的另起一行selGridIndex = GUI.SelectionGrid(new Rect(0, 50, 200, 90), selGridIndex, toolbarInfos, 1);
}

2、滚动视图和分组

1、分组

用于批量控制空间位置
public Rect groupPos;
private void OnGUI()
{GUI.BeginGroup(groupPos);GUI.Button(new Rect(0, 0, 100, 50), "按钮");GUI.Label(new Rect(0, 60, 100, 20), "Lable");GUI.EndGroup();
}

2、滚动列表

public Rect scPos; //可视范围
public Rect showPos; //内容
private Vector2 nowPos;
private string[] strs = new string[] { "选项一", "选项二", "选项三" };private void OnGUI()
{nowPos = GUI.BeginScrollView(scPos, nowPos, showPos);GUI.Toolbar(new Rect(0, 0, 300, 50), 0, strs);GUI.EndScrollView();
}

3、窗口相关

1、窗口

private void DrawWindow(int id)
{GUI.Button(new Rect(0, 30, 30, 20), "按钮");
}
private void OnGUI()
{//参数1:idGUI.Window(1, new Rect(100, 100, 200, 150), DrawWindow, "窗口");
}

2、模态窗口

优先处理窗口(警告窗口)GUI.ModalWindow(2, new Rect(100, 100, 200, 150), DrawWindow, "模态窗口");

3、拖动窗口

dragWinPos = GUI.Window(3, dragWinPos, DrawWindow, "窗口");
//参数用来设置可拖动位置
private void DrawWindow(int id)
{GUI.DragWindow();
}

4、自定义整体样式

在这里插入图片描述

1、GUIskin

1、全局颜色

全局着色,影响背景和文本颜色GUI.color = Color.red;
文本着色GUI.contentColor = Color.yellow;
背景元素着色GUI.backgroundColor = Color.red;
注意:会和全局颜色相乘

2、整体皮肤样式

public GUISkin skin;GUI.skin = skin;

2、GUILayout

1、GUILayout 自动布局

GUILayout.BeginArea(new Rect(100,100,100,100)); //设置整体位置,宽高为可见范围
//GUI.BeginGroup(new Rect(100,100,100,100)); GUI综合使用
GUILayout.BeginHorizontal(); //水平布局
GUILayout.BUtton("按钮");
GUILayout.Endorizontal();
GUILayout.EndArea;
GUI.EndGroup();

2、GUILayoutOption 布局选项

GUILayout.BUtton("按钮",GUILayout.With(300));控件的固定宽高GUILayout.Width(300); GUILayout.Height(200); 
充许控件的最小宽高GuILayout.Minwidth(50); GuILayout.MinHeight(50));
充许控件的最大宽高GuILayout.Maxwidth(100) GUILayout.MaxHeight(100)); 
充许或禁止水平拓展GuILayout.Expandwidth(true); //允许GUILayout.ExpandHeight(false); //禁止GUILayout.ExpandHeight(true); //允许GUILayout.ExpandHeight(false); //禁止

编辑模式下让指定代码运行

添加特性[ExecuteAlways]

实践小项目

1、需求分析

1、位置信息类

位置信息类中心点位置偏移位置宽高最终位置中心点对齐方式屏幕对齐方式

2、控件基类

控件基类位置信息内容信息自定义样式是否开启自定义样式

2、九宫格布局概念

九宫格原点:左上(0,0)(w/2,0)    右上(w,0)(0,h/2)(w/2,h/2)(w,h/2)左下(0,h)(w/2,h)    右下(w,h)控件位置:(0,0)      (-cw/2,0)      (-cw,0)(0,-ch/2)  (-cw/2,-ch/2)  (-cw,-ch/2)(0,-ch)    (-cw/2,-ch)    (-cw,-ch)控件坐标计算公式:相对屏幕位置 + 中心点偏移位置 + 偏移位置

3、控件位置信息类

CustomGUIPos

using UnityEngine;public enum E_Alignment_Type
{Up, Down, Left, Right,Center,Left_Up, Left_Down, Right_Up, Right_Down,
}public class CustomGUIPos
{private Rect rpos = new Rect(0, 0, 100, 100);//屏幕九宫格对齐方式public E_Alignment_Type screen_Alignment_Type;//控件中心对齐方式public E_Alignment_Type control_Center_Alignment_Type;//偏移位置public Vector2 pos;//控件宽高public float width = 100;public float height = 50;//中心点private Vector2 centerPos;//控件中心点偏移位置private void CalcCenterPos(){switch (control_Center_Alignment_Type){case E_Alignment_Type.Up:centerPos.x = -width / 2;centerPos.y = 0;break;case E_Alignment_Type.Down:centerPos.x = -width / 2;centerPos.y = -height;break;case E_Alignment_Type.Left:centerPos.x = 0;centerPos.y = -height / 2;break;case E_Alignment_Type.Right:centerPos.x = -width;centerPos.y = -height / 2;break;case E_Alignment_Type.Center:centerPos.x = -width / 2;centerPos.y = -height / 2;break;case E_Alignment_Type.Left_Up:centerPos.x = 0;centerPos.y = 0;break;case E_Alignment_Type.Left_Down:centerPos.x = 0;centerPos.y = -height;break;case E_Alignment_Type.Right_Up:centerPos.x = -width;centerPos.y = 0;break;case E_Alignment_Type.Right_Down:centerPos.x = -width;centerPos.y = -height;break;}}//最终位置private void CalcPos(){switch (screen_Alignment_Type){case E_Alignment_Type.Up://相对屏幕位置 + 中心点偏移位置 + 偏移位置rpos.x = Screen.width / 2 + centerPos.x + pos.x;rpos.y = 0 + centerPos.y + pos.y;break;case E_Alignment_Type.Down:rpos.x = Screen.width / 2 + centerPos.x + pos.x;rpos.y = Screen.height + centerPos.y - pos.y;break;case E_Alignment_Type.Left:rpos.x = 0 + centerPos.x + pos.x;rpos.y = Screen.height / 2 + centerPos.y + pos.y;break;case E_Alignment_Type.Right:rpos.x = Screen.width + centerPos.x - pos.x;rpos.y = Screen.height / 2 + centerPos.y + pos.y;break;case E_Alignment_Type.Center:rpos.x = Screen.width / 2 + centerPos.x + pos.x;rpos.y = Screen.height / 2 + centerPos.y + pos.y;break;case E_Alignment_Type.Left_Up:rpos.x = centerPos.x + pos.x;rpos.y = centerPos.y + pos.y;break;case E_Alignment_Type.Left_Down:rpos.x = centerPos.x + pos.x;rpos.y = Screen.height + centerPos.y - pos.y;break;case E_Alignment_Type.Right_Up:rpos.x = Screen.width + centerPos.x - pos.x;rpos.y = centerPos.y + pos.y;break;case E_Alignment_Type.Right_Down:rpos.x = Screen.width + centerPos.x - pos.x;rpos.y = Screen.height + centerPos.y - pos.y;break;}}public Rect Pos{get{//计算中心点偏移CalcCenterPos();//相对屏幕坐标点CalcPos();//修改控件的宽高rpos.width = width;rpos.height = height;return rpos;}}
}

4、控件父类

CustomGUIControl

using UnityEngine;public enum E_style_OnOff
{On,Off,
}
public class CustomGUIControl : MonoBehaviour
{//位置信息public CustomGUIPos guiPos;//显示内容信息public GUIContent content;//自定义样式public GUIStyle style;//自定义样式开关public E_style_OnOff styleOn_or_Off = E_style_OnOff.Off;private void OnGUI(){switch (styleOn_or_Off){case E_style_OnOff.On:StyleOnDraw();break;case E_style_OnOff.Off:StyleOffDraw();break;}}protected virtual void StyleOnDraw(){//GUI.Button(guiPos.Pos, content, style);}protected virtual void StyleOffDraw(){//GUI.Button(guiPos.Pos, content);}
}

5、父对象控制绘制顺序

修改CustomGUIControl

//public void OnGUI()修改为
public void DrawGUI(){}

CustomGUIRoot

using UnityEngine;[ExecuteAlways] //编辑模式下能看到GUI
public class CustomGUIRoot : MonoBehaviour
{//存储子对象所有的GUI控件的容器private CustomGUIControl[] allControls;void Start(){allControls = this.GetComponentsInChildren<CustomGUIControl>();}//同一绘制子对象控件private void OnGUI(){if (!Application.isPlaying){//得到父类脚本allControls = this.GetComponentsInChildren<CustomGUIControl>();}//可以控件控件的绘制顺序for (int i = 0; i < allControls.Length; i++){//绘制每个控件allControls[i].DrawGUI();}}
}

6、自定义常用控件

1、自定义文本和按钮

CustomGUILable

using UnityEngine;public class CustomGUILable : CustomGUIControl
{protected override void StyleOffDraw(){GUI.Label(guiPos.Pos, content);}protected override void StyleOnDraw(){GUI.Label(guiPos.Pos, content, style);}
}

CustomGUIButton

using UnityEngine;
using UnityEngine.Events;public class CustomGUIButton : CustomGUIControl
{public event UnityAction clickEvent;protected override void StyleOffDraw(){if (GUI.Button(guiPos.Pos,content)){clickEvent?.Invoke();}}protected override void StyleOnDraw(){if (GUI.Button(guiPos.Pos, content, style)){clickEvent?.Invoke();}}
}

2、自定义多选框

CustomGUIToggle

using UnityEngine;
using UnityEngine.Events;public class CustomGUIToggle : CustomGUIControl
{public bool isSel;public event UnityAction<bool> changeValue;private bool isOldSel;protected override void StyleOffDraw(){isSel = GUI.Toggle(guiPos.Pos, isSel, content);if(isOldSel != isSel ){changeValue?.Invoke(isSel);isOldSel = isSel;}}protected override void StyleOnDraw(){isSel = GUI.Toggle(guiPos.Pos, isSel, content, style);if (isOldSel != isSel){changeValue?.Invoke(isSel);isOldSel = isSel;}}
}

3、自定义多选框控件(单选)

CustomGUIToggleGroup

using UnityEngine;public class CustomGUIToggleGroup : MonoBehaviour
{public CustomGUIToggle[] toggles;private CustomGUIToggle frontTrueTog;void Start(){if (toggles.Length == 0)return;for (int i = 0; i < toggles.Length; i++){CustomGUIToggle toggle = toggles[i];toggle.changeValue += (value) =>{if(value){for (int j = 0; j < toggles.Length; j++){//其他的变falseif (toggles[j] != toggle){toggles[j].isSel = false;}}frontTrueTog = toggle;}else if (toggle == frontTrueTog){toggle.isSel = true;}};}}
}

4、自定义输入框和拖动条

CustomGUIInput

using UnityEngine;
using UnityEngine.Events;public class CustomGUIInput : CustomGUIControl
{public event UnityAction<string> textChange;private string oldStr = "";protected override void StyleOffDraw(){content.text = GUI.TextField(guiPos.Pos,content.text);if(oldStr != content.text){textChange?.Invoke(oldStr);oldStr = content.text;}}protected override void StyleOnDraw(){content.text = GUI.TextField(guiPos.Pos, content.text, style);if (oldStr != content.text){textChange?.Invoke(oldStr);oldStr = content.text;}}
}

CustomGUISlider

using UnityEngine;
using UnityEngine.Events;public enum E_Slider_Type
{Horizontal, //水平Vertical, //竖直
}
public class CustomGUISlider : CustomGUIControl
{public float minValue = 0;public float maxValue = 1;public float nowValue = 0;public E_Slider_Type type = E_Slider_Type.Horizontal;public GUIStyle styleThumb; //小按钮的stylepublic event UnityAction<float> changeValue;private float oldValue = 0;protected override void StyleOffDraw(){switch (type){case E_Slider_Type.Horizontal:nowValue = GUI.HorizontalSlider(guiPos.Pos, nowValue, minValue, maxValue);break;case E_Slider_Type.Vertical:nowValue = GUI.VerticalSlider(guiPos.Pos, nowValue, minValue, maxValue);break;}if (oldValue!=nowValue){changeValue?.Invoke(nowValue);oldValue = nowValue;}}protected override void StyleOnDraw(){switch (type){case E_Slider_Type.Horizontal:nowValue = GUI.HorizontalSlider(guiPos.Pos, nowValue, minValue, maxValue, style, styleThumb);break;case E_Slider_Type.Vertical:nowValue = GUI.VerticalSlider(guiPos.Pos, nowValue, minValue, maxValue, style, styleThumb);break;}if (oldValue != nowValue){changeValue?.Invoke(nowValue);oldValue = nowValue;}}
}

5、自定义图片绘制

CustomGUITexture

using UnityEngine;public class CustomGUITexture : CustomGUIControl
{public ScaleMode scaleMode = ScaleMode.StretchToFill;protected override void StyleOffDraw(){GUI.DrawTexture(guiPos.Pos,content.image, scaleMode);}protected override void StyleOnDraw(){GUI.DrawTexture(guiPos.Pos, content.image, scaleMode);}
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/pingmian/35258.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

微信小程序画布

canvas&#xff1a; 微信小程序中的canvas组件提供了绘制图片、文字、图形等功能&#xff0c;可以实现丰富的图形和动画效果。以下是关于canvas的使用方法和属性&#xff1a; 1.属性 canvas-id&#xff1a;&#xff08;必选&#xff09;Canvas 组件的唯一标识符&#xff0c;用…

MySQL——去重及数据库的表达式

去重 DISTINCT 作用&#xff1a;去除select语句查询出的结果中重复的数据&#xff0c;只显示出重复数据中的一条 代码演示&#xff1a; -- 查询一下有哪些同学参加了考试SELECT * FROM result -- 查询全部的考试成绩 SELECT studentno FROM result -- 查询有哪些同学参加了…

DC/AC电源模块:为新能源汽车充电系统提供高效能源转换

BOSHIDA DC/AC电源模块&#xff1a;为新能源汽车充电系统提供高效能源转换 DC/AC电源模块是新能源汽车充电系统中至关重要的组件&#xff0c;它能够将直流电转换为交流电&#xff0c;为电动车提供高效能源转换。随着人们对可持续能源的需求日益增长&#xff0c;新能源汽车成为…

题目:利用递归函数调用方式,将所输入的5个字符,以相反顺序打印出来。

代码&#xff1a; #include <stdio.h> // 递归函数&#xff0c;用于打印字符数组的剩余部分&#xff08;反向&#xff09; void printReverse(char arr[], int index) { // 递归终止条件&#xff1a;当索引小于0时&#xff0c;不再打印 if (index < 0) { retur…

java基于ssm+jsp 足球赛会管理系统

1前台首页功能模块 足球赛会管理系统&#xff0c;在系统首页可以查看首页、球队介绍、球星介绍、线下足球赛、论坛信息、个人中心、后台管理、在线客服等内容&#xff0c;如图1所示。 图1前台首页功能界面图 用户登录、用户注册&#xff0c;在注册页面可以填写账号、密码、姓名…

第16天:部署准备与CI/CD

第16天&#xff1a;部署准备与CI/CD 目标 准备项目部署到生产环境&#xff0c;并设置持续集成和持续部署&#xff08;CI/CD&#xff09;。 任务概览 学习Django项目部署的基本知识。配置WSGI服务器&#xff0c;如Gunicorn。设置CI/CD流程&#xff0c;如使用Travis CI或Jenk…

【sqlmap命令学习及测试dvwa_SQL_Injection】

文章目录 1.sqlmap命令及 不同级别探索 能否注入命令option1.1 low等级1.2 Medium等级1. 3 High等级 2. 注入流程2.1 数据库2.2 指定数据库表名2.3 指定表的 字段名2.4 内容2.5 当前用户信息2.6 用户密码2.7 其他 1.sqlmap命令及 不同级别探索 能否注入 命令option sqlmap -u…

昇思25天学习打卡营第2天|MindSpore快速入门-张量

张量 Tensor 张量&#xff08;Tensor&#xff09;是一个可用来表示在一些矢量、标量和其他张量之间的线性关系的多线性函数&#xff0c;这些线性关系的基本例子有内积、外积、线性映射以及笛卡儿积。 张量是一种特殊的数据结构&#xff0c;与数组和矩阵非常相似。张量&#x…

《C语言》编译和链接

文章目录 一、翻译环境1、预处理2、编译3、汇编4、链接 二、运行环境 一、翻译环境 在使用编译器编写代码时&#xff0c;编写的代码是高级语言&#xff0c;机器无法直接识别和运行&#xff0c;在编译器内部会翻译成机器可执行的机器语言。 编译环境由编译和链接两大过程组成。 …

【编译原理】绪论

1.计算机程序语言以及编译 编译是对高级语言的翻译 源程序是句子的集合&#xff0c;树可以较好的反应句子的结构 编译程序是一种翻译程序 2.编号器在语言处理系统中的位置 可重定位&#xff1a;在内存中存放的起始位置不是固定的 加载器&#xff1a;修改可重定位地址&#x…

Node.js 语言特定指南

Node.js 语言特定指南 本 Node.js 语言特定指南将教您如何使用 Docker 容器化 Node.js 应用程序。在本指南中&#xff0c;您将学习如何&#xff1a; 容器化并运行一个 Node.js 应用程序设置一个本地环境以使用容器开发 Node.js 应用程序使用容器为 Node.js 应用程序运行测试使…

基于weixin小程序的民宿短租系统的设计与实现

管理员账户功能包括&#xff1a;系统首页&#xff0c;个人中心&#xff0c;房主管理&#xff0c;房间类型管理&#xff0c;用户管理&#xff0c;民宿信息管理&#xff0c;民宿预订管理&#xff0c;系统管理 小程序功能包括&#xff1a;系统首页&#xff0c;民宿信息&#xff0c…

博客solo!bolo-solo让博客创作更自由。

bolo-solo&#xff1a;独行侠的数字笔录&#xff0c; 你的博客新伙伴- 精选真开源&#xff0c;释放新价值。 概览 bolo-solo是GitHub 上一个开源的个人博客系统&#xff1a;Bolo Solo&#xff0c;简单易部署&#xff0c;自带精致主题、数据统计表、邮件提醒、自定义图床、功能…

Python实战:从零开始打造BS自动化运维平台

注意:本文的下载教程,与以下文章的思路有相同点,也有不同点,最终目标只是让读者从多维度去熟练掌握本知识点。 下载教程:Python自动化运维项目开发实战_从零开始打造BS自动化运维平台_编程案例实例课程教程.pdf 随着信息技术的快速发展,企业对于运维效率和安全性的要求越…

Jboss多个远程命令执行漏洞(CVE-2017-12149、CVE-2015-7501、CVE-2017-7504)

目录 Jboss介绍 CVE-2017-12149 漏洞产生的原因 环境搭建 漏洞检测和利用 反弹shell CVE-2015-7501 漏洞产生的原因 环境搭建 漏洞检测和利用 反弹shell CVE-2017-7504 漏洞产生的原因 环境搭建 漏洞检测和利用 反弹shell 这一篇是参考大佬的好文章进行Jboos的…

【AIGC】如何从0开始快速打造个人知识库

如何从0开始快速打造个人知识库 文章目录 如何从0开始快速打造个人知识库前言1、注册登录2、创建知识库2.1 创建2.2 文件上传 3、使用知识库 前言 最近我在使用一些AIGC的产品时发现一个问题&#xff0c;我没有办法让它能够结合我现有的数据内容回答我的问题&#xff0c;并且让…

django学习入门系列之第三点《案例 小米商城二级菜单》

文章目录 样例划分区域搭建骨架logo区域完整代码 小结往期回顾 样例 划分区域 搭建骨架 <!-- 二级菜单部分 --> <div class"sub-header"><div class"container"><div class"logo">1</div><div class"sea…

JFrame和JScrollPanel布局初步使用

还不是很了解&#xff0c;做了几个程序&#xff1b; import java.awt.Container; import java.awt.Color; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.border.EmptyBorder;public class pa1 {public static void main(String[] agrs){JF…

24/06/25(4.1122)数据存储,自定义类型

重点:1.数据类型详细介绍 2.整型在内存中的存储:原码 反码 补码 3.大小端字节序介绍和判断 4.浮点型在内存中的存储解析 前面都有char short int...详细介绍,翻一翻.需要注意的是,C语言没有字符串类型哦. 计算机永远存储的都是补码,计算也是用补码进行的,只有在要输出的时候转…

Vite: 新一代高效的前端构建工具

概述 随着前端技术的飞速发展&#xff0c;构建工具在项目开发中扮演着至关重要的角色因为项目日益复杂&#xff0c;开发体验和构建效率成为了开发者关注的焦点在众多前端构建工具中&#xff0c;Vite凭借其独特的优势&#xff0c;逐渐成为开发者们的新宠Vite&#xff0c;作为一…