HarmonyOS开发(ArkUI简单使用)

news2024/10/17 7:43:35

一、开发准备

1.官网 

https://developer.huawei.com/consumer/cn/

2.工具

DevEco Studio

下载: 下载中心 | 华为开发者联盟-HarmonyOS开发者官网,共建鸿蒙生态

3.安装

4.开发组件ArkTs

ArkTS是HarmonyOS主力应用开发语言。它在TypeScript(简称TS)的基础上,匹配ArkUI框架,扩展了声明式UI、状态管理等相应的能力,让开发者以更简洁、更自然的方式开发跨端应用。

5.快速上手

 

 6.ArkTS工程目录结构(Stage模型)

7.安装模拟器

 

 

解决措施

首先打开控制面板 > 程序 > 程序与功能 > 启动或关闭Windows功能,找到并勾选“Hyper-V”、“Windows虚拟机监控程序平台”、“虚拟机平台”,点击确定并重启电脑。若勾选后启动模拟器仍然提示该错误,需要以管理员权限打开命令行窗口并执行:`bcdedit /set hypervisorlaunchtype auto`并重启电脑。

二、ArkUI

ArkUI(方舟UI框架)为应用的UI开发提供了完整的基础设施,包括简洁的UI语法、丰富的UI功能(组件、布局、动画以及交互事件),以及实时界面预览工具等,可以支持开发者进行可视化界面开发。

1.图片显示组件
a.声明Image组件并设置图片源 
Image(src:string|PixelMap|Resource)

Image('https://xxx.png')
Image(PixelMapObject)
Image($r('app.media.mate60'))
Image($rawfile('mate60.png'))

string格式,通常用来加载网络图片,需要申请网络访问权限:obos.permission.INTERNET

PixelMap格式,可以加载像素图,常用在图片编辑器中

Resource格式,加载本地图片,推荐使用

b.添加图片属性
Image($r('app.media.icon'))
    .width(100)
    .height(120)
    .borderRadius(10)
    .interpolation(ImageInterpolation.High)
2.文本显示组件
a.声明Text组件并设置文本内容
Text(content?:string|Resource)

Text('图片宽度')
Text($r('app.string.width_label'))

string格式,直接写文本内容

Resource格式,读取本地资源文件

 b.添加图片属性
Text('注册账号')
    .lineHeight(32)
    .fontSize(20)
    .fontColor('#ff1876f8')
    .fontWeight(FontWeight.Medium)
 3.文本输入框
a.声明TextInput组件
TextInput({placeHolder?:ResourceStr,text?:ResourceStr})

TextInput({placeHolder:'请输入账号或手机号'})

placeHolder输入框无输入时的提示文本

text输入框当前的文本内容

 b.添加属性和事件
TextInput({text:'请输入账号或手机号'})
    .width(150)
    .height(30)
    .backgroundColor('#fff')
    .type(InputType.Password)
    .onChange(value=>{console.log(value)})
 4.按钮输入框
a.声明Button组件,label是按钮文字
Button(label?:ResourceStr)

Button('点我')
Button(){
    Image($r('app.media.search))
        .width(20)
        .margin(10)
}

文字型按钮

自定义按钮,在Button组件内嵌套其他组件

 b.添加属性和事件
Button('点我')
    .width(100)
    .height(30)
    .type(ButtonType.Normal)
    .onClick(()=>{})
 5.滑动条组件
Slider(options?:SilderOptions)

Slider({
     min:10,
     max:100,
     value:30,
     step:10,
     style:SliderStyle.OutSet,
     direction:Axis.Horizontal,
     reverse:false
})
     .width('90%')
     .showTips(true)
     .blockColor('#36d')
     .onChange(()=>{})
6.布局组件

Column容器从上往下排列

Row容器从左往右排列

间距:Space

7.示例

@Entry
@Component
struct Index {
  @State imageWidth: number = 250;
  build() {
      Column() {
        Row(){
          Image('https://tse4-mm.cn.bing.net/th?id=OIP.nweYnRD-9eFP3nNgNDU9gwHaGt&pid=1.7&w=217&h=198&c=8&dpr=0.9')
            .width(this.imageWidth)
        }
        .width('100%')
        .height(400)
        .justifyContent(FlexAlign.Center)
        Row(){
          Text($r('app.string.width_label'))
            .fontSize(20)
            .fontWeight(FontWeight.Bold)
          TextInput({ placeholder: '请输入图片宽度', text: this.imageWidth.toFixed(0) })
            .width(150)
            .backgroundColor('#fff')
            .type(InputType.Number)
            .onChange(val=>{
              console.log(val)
              this.imageWidth=parseInt(val)
            })
        }
        .width('100%')
        .height(60)
        .justifyContent(FlexAlign.SpaceAround)
        Divider().width('91%')
        Row(){
          Button('缩小')
            .width(80)
            .height(30)
            .type(ButtonType.Normal)
            .onClick(()=>{
              if(this.imageWidth>=10){
                this.imageWidth-=10
              }
            })
          Button('放大')
            .width(80)
            .height(30)
            .type(ButtonType.Normal)
            .onClick(()=>{
              if(this.imageWidth<=340){
                this.imageWidth+=10
              }
            })
        }
        .width('100%')
        .height(60)
        .justifyContent(FlexAlign.SpaceAround)
        Slider({
          min:10,
          max:340,
          value:this.imageWidth,
          step:10,
          style:SliderStyle.OutSet,
          direction:Axis.Horizontal,
          reverse:false
        })
          .width('90%')
          .showTips(true)
          .trackThickness(8)
          .blockColor('#36d')
          .onChange((val)=>{this.imageWidth=val})
      }
      .width('100%')
      .height('100%')
  }
}

 三、渲染控制(ForEach,if-else)

1.ForEach
a.语法
ForEach(
    //要遍历的数组数据
    arr:Array,

    //页面组件生成函数
    (item:any,index?:number)=>{
        Row(){
            Image('mate60.jpg')
            Column(){
                Text('mate60')
                Text('12700.00')
            }
        }
    },

    //键生成函数,为数组每一项生成一个唯一标识,组件是否重新渲染的判断标准
    keyGenerator?:(item:any,index?:numbe):string=>{
    
    }
)
b.示例

class Item {
  name:string
  image:ResourceStr
  price:number
  constructor( name:string, image:ResourceStr, price:number) {
    this.name=name
    this.image=image
    this.price=price
  }
}
@Entry
@Component
struct Index {
  private items:Array<Item>=[
    new Item('华为Mate60',$r('app.media.mate'),6999),
    new Item('华为MateBookProX',$r('app.media.mate'),13999),
    new Item('华为WatchGT4',$r('app.media.mate'),1438),
    new Item('华为FreeBudPro3',$r('app.media.mate'),1499),
    new Item('华为MateX5',$r('app.media.mate'),12999)
  ]
  build() {
      Column({space:8}) {
        Row(){
          Text('商品列表')
            .fontSize(20)
            .fontWeight(FontWeight.Bold)
        }
        .width('100%')
        .height(60)
        .margin({bottom:20})

        ForEach(
          this.items,
          (item:Item)=>{
            Row({space:10}){
              Image(item.image)
                .width('20%')
              Column({space:4}){
                Text(item.name)
                  .fontSize(20)
                  .fontWeight(FontWeight.Bold)
                Text(`¥ ${item.price}`)
                  .fontSize(20)
                  .fontWeight(FontWeight.Bold)
                  .fontColor('red')
              }
              .alignItems(HorizontalAlign.Start)
            }
            .width('92%')
            .height(100)
            .padding(10)
            .backgroundColor('#fff')
            .borderRadius(20)
            .justifyContent(FlexAlign.Start)
          }
        )
      }
      .width('100%')
      .height('100%')
      .backgroundColor('#ccc')
  }
}
 2.if-else条件渲染

class Item {
  name:string
  image:ResourceStr
  price:number
  discount:number
  constructor( name:string, image:ResourceStr, price:number,discount:number=0) {
    this.name=name
    this.image=image
    this.price = price;
    this.discount=discount
  }
}
@Entry
@Component
struct Index {
  private items:Array<Item>=[
    new Item('华为Mate60',$r('app.media.mate'),6999,500),
    new Item('华为MateBookProX',$r('app.media.mate'),13999),
    new Item('华为WatchGT4',$r('app.media.mate'),1438),
    new Item('华为FreeBudPro3',$r('app.media.mate'),1499),
    new Item('华为MateX5',$r('app.media.mate'),12999)
  ]
  build() {
      Column({space:8}) {
        Row(){
          Text('商品列表')
            .fontSize(20)
            .fontWeight(FontWeight.Bold)
        }
        .width('100%')
        .height(60)
        .margin({bottom:20})

        ForEach(
          this.items,
          (item:Item)=>{
            Row({space:10}){
              Image(item.image)
                .width('20%')
              Column({space:4}){
                if(item.discount){
                  Text(item.name)
                    .fontSize(20)
                    .fontWeight(FontWeight.Bold)
                  Text(`原件¥ ${item.price}`)
                    .fontSize(16)
                    .fontWeight(FontWeight.Bold)
                    .fontColor('#ccc')
                    .decoration({type:TextDecorationType.LineThrough})
                  Text('折扣价¥ '+(item.price-item.discount))
                    .fontSize(20)
                    .fontWeight(FontWeight.Bold)
                    .fontColor('red')
                  Text(`补贴¥ ${item.discount}`)
                    .fontSize(20)
                    .fontWeight(FontWeight.Bold)
                    .fontColor('red')
                }else{
                  Text(item.name)
                    .fontSize(20)
                    .fontWeight(FontWeight.Bold)
                  Text(`¥ ${item.price}`)
                    .fontSize(20)
                    .fontWeight(FontWeight.Bold)
                    .fontColor('red')
                }
              }
              .alignItems(HorizontalAlign.Start)
            }
            .width('92%')
            .height(120)
            .padding(10)
            .backgroundColor('#fff')
            .borderRadius(20)
            .justifyContent(FlexAlign.Start)
          }
        )
      }
      .width('100%')
      .height('100%')
      .backgroundColor('#ccc')
  }
}
3.List

列表List是一种复杂容器,具备以下特点:

列表项ListItem数量过多超出屏幕后,会自动提供滚动功能

列表项ListItem既可以纵向排列,也可以横向排列

a.语法
List({space:10}){
    ForEach([1,2,3,4],(item)=>{
        ListItem(){
         //列表项内容,只能包含一个根组件
        }
    })
}
.width('100%')
.listDirection(Axis.Vertical)//列表方向,默认纵向垂直,水平方向Horizontal
b.示例

class Item {
  name:string
  image:ResourceStr
  price:number
  discount:number
  constructor( name:string, image:ResourceStr, price:number,discount:number=0) {
    this.name=name
    this.image=image
    this.price = price;
    this.discount=discount
  }
}
@Entry
@Component
struct Index {
  private items:Array<Item>=[
    new Item('华为Mate60',$r('app.media.mate'),6999,500),
    new Item('华为MateBookProX',$r('app.media.mate'),13999),
    new Item('华为WatchGT4',$r('app.media.mate'),1438),
    new Item('华为FreeBudPro3',$r('app.media.mate'),1499),
    new Item('华为MateX5',$r('app.media.mate'),12999),
    new Item('华为WatchGT4',$r('app.media.mate'),1438),
    new Item('华为FreeBudPro3',$r('app.media.mate'),1499),
    new Item('华为MateX5',$r('app.media.mate'),12999)
  ]
  build() {
      Column({space:8}) {
        Row(){
          Text('商品列表')
            .fontSize(20)
            .fontWeight(FontWeight.Bold)
        }
        .width('100%')
        .height(30)
        .margin({bottom:20})

        List({space:8}){
          ForEach(this.items,(item:Item)=>{
            ListItem(){
              //列表项内容,只能包含一个根组件
              Row({space:10}){
                Image(item.image)
                  .width('20%')
                Column({space:4}){
                  if(item.discount){
                    Text(item.name)
                      .fontSize(20)
                      .fontWeight(FontWeight.Bold)
                    Text(`原件¥ ${item.price}`)
                      .fontSize(16)
                      .fontWeight(FontWeight.Bold)
                      .fontColor('#ccc')
                      .decoration({type:TextDecorationType.LineThrough})
                    Text('折扣价¥ '+(item.price-item.discount))
                      .fontSize(20)
                      .fontWeight(FontWeight.Bold)
                      .fontColor('red')
                    Text(`补贴¥ ${item.discount}`)
                      .fontSize(20)
                      .fontWeight(FontWeight.Bold)
                      .fontColor('red')
                  }else{
                    Text(item.name)
                      .fontSize(20)
                      .fontWeight(FontWeight.Bold)
                    Text(`¥ ${item.price}`)
                      .fontSize(20)
                      .fontWeight(FontWeight.Bold)
                      .fontColor('red')
                  }
                }
                .alignItems(HorizontalAlign.Start)
              }
              .width('92%')
              .height(120)
              .padding(10)
              .backgroundColor('#fff')
              .borderRadius(20)
              .justifyContent(FlexAlign.Start)
            }
          })
        }
        .width('100%')
        .layoutWeight(1)
      }
  }
}

四、自定义组件

1.拆分组件
@Component
struct Com {
  private title:string=''
  build(){
    //组件UI描述 
  }
}

@Component
struct XxxPage {
  build(){
    //使用组件
    Com({title:'标题'})
  }
}
2.在页面中引入Header组件
3.全局自定义构建函数
@Builder function XxxBuilder(){
    //UI描述
}
@Component
struct XxxPage {
    build(){
        XxxBuilder()
    }
}
4.局部自定义构建函数
@Component
struct XxxPage {
    @Builder YyyBuilder(){
        //UI描述
    }
    build(){
        this.YyyBuilder()
    }
}
5.全局公共样式函数

仅可封装组件的通用属性

@Styles function fillScreen(){
  .width('100%')
  .height('100%')
  .backgroundColor('#f6f6f6')
}
//Extend装饰器,继承模式,只能写在全局位置
@Extend(Text) function priceText(){
  .fontSize(20)
  .fontWeight(FontWeight.Bold)
  .fontColor('red')
}
6.局部公共样式函数
@Component
struct XxxPage {
    @Builder YyyBuilder(){
        //UI描述
    }
    build(){
        this.YyyBuilder()
        .fillScreen()
    }
    //局部公共样式函数
    @Styles  fillScreen(){
        .width('100%')
        .height('100%')
        .backgroundColor('#f6f6f6')
    }
}
7.示例

@Component
export struct Header {
  private title:ResourceStr|string=''
  build(){
    Row(){
      Image($r('app.media.left'))
        .width(30)
        .onClick(()=>{})
      Text(this.title)
        .fontSize(20)
        .fontWeight(FontWeight.Bold)
      Blank()
      Image($r('app.media.reset'))
        .width(24)
        .onClick(()=>{})
    }
    .width('100%')
    .height(30)
    .backgroundColor('#f6f6f6')
  }
}
import {Header} from '../Com/CommomCom';
class Item {
  name:string
  image:ResourceStr
  price:number
  discount:number
  constructor( name:string, image:ResourceStr, price:number,discount:number=0) {
    this.name=name
    this.image=image
    this.price = price;
    this.discount=discount
  }
}
//全局自定义构建函数
// @Builder function ItemCard(item:Item){
// }
//全局公共样式函数
@Styles function fillScreen(){
  .width('100%')
  .height('100%')
  .backgroundColor('#f6f6f6')
}
//继承模式,只能写在全局位置
@Extend(Text) function priceText(){
  .fontSize(20)
  .fontWeight(FontWeight.Bold)
  .fontColor('red')
}

@Entry
@Component
struct Index {
  private items:Array<Item>=[
    new Item('华为Mate60',$r('app.media.mate'),6999,500),
    new Item('华为MateBookProX',$r('app.media.mate'),13999),
    new Item('华为WatchGT4',$r('app.media.mate'),1438),
    new Item('华为FreeBudPro3',$r('app.media.mate'),1499),
    new Item('华为MateX5',$r('app.media.mate'),12999),
    new Item('华为WatchGT4',$r('app.media.mate'),1438),
    new Item('华为FreeBudPro3',$r('app.media.mate'),1499),
    new Item('华为MateX5',$r('app.media.mate'),12999)
  ]
  build() {
      Column({space:8}) {
        //标题部分
        Header({title:'商品列表'})
          .margin({top:10})
          .padding({left:20,right:20})
        //商品列表部分
        List({space:8}){
          ForEach(this.items,(item:Item)=>{
            ListItem(){
              //列表项内容,只能包含一个根组件
              this.ItemCard(item)
            }
          })
        }
        .width('100%')
        .padding(20)
        .layoutWeight(1)
      }
    .fillScreen()
  }
  //局部自定义构建函数
  @Builder  ItemCard(item:Item){
  Row({space:10}){
    Image(item.image)
      .width('20%')
    Column({space:4}){
      if(item.discount){
        Text(item.name)
          .fontSize(20)
          .fontWeight(FontWeight.Bold)
        Text(`原件¥ ${item.price}`)
          .fontSize(16)
          .fontWeight(FontWeight.Bold)
          .fontColor('#ccc')
          .decoration({type:TextDecorationType.LineThrough})
        Text('折扣价¥ '+(item.price-item.discount))
          .priceText()
        Text(`补贴¥ ${item.discount}`)
          .priceText()
      }else{
        Text(item.name)
          .fontSize(20)
          .fontWeight(FontWeight.Bold)
        Text(`¥ ${item.price}`)
          .priceText()
      }
    }
    .alignItems(HorizontalAlign.Start)
  }
  .justifyContent(FlexAlign.Start)
  .CardItemScreen()
  }
  //局部公共样式函数
  @Styles  fillScreen(){
    .width('100%')
    .height('100%')
    .backgroundColor('#f6f6f6')
  }
  @Styles  CardItemScreen(){
    .width('100%')
    .height(120)
    .backgroundColor('#fff')
    .borderRadius(20)
  }
}

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

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

相关文章

分享一个关于产线工控安全的主机加固方案

在数字化时代&#xff0c;数据安全是企业运营的重中之重。勒索病毒作为一种新型的网络攻击手段&#xff0c;已经成为全球范围内企业面临的严峻挑战。最近&#xff0c;一起震惊全球的勒索病毒事件再次敲响了警钟&#xff1a;一家国际航运巨头遭受了勒索软件攻击&#xff0c;导致…

设计模式和软件框架的关系

设计模式和软件框架在软件开发中都有助于解决复杂问题和提高代码质量&#xff0c;但它们在概念和使用上存在一些区别。它们的关系可以通过以下几点理解&#xff1a; 层次与抽象程度 设计模式&#xff08;Design Patterns&#xff09;是一组通用的、可复用的解决方案&#xff0…

Android10 recent键相关总结

目录 初始化流程 点击Recent键流程 RecentsActivity 显示流程 RecentsModel 获取数据管理类 RecentsActivity 布局 已处于Recent界面时 点击recent 空白区域 点击返回键 recent组件配置 Android10 Recent 功能由 System UI&#xff0c;Launcher共同实现。 初始化流程 …

注册_登录安全分析报告:宝马中国

前言 由于网站注册入口容易被黑客攻击&#xff0c;存在如下安全问题&#xff1a; 暴力破解密码&#xff0c;造成用户信息泄露短信盗刷的安全问题&#xff0c;影响业务及导致用户投诉带来经济损失&#xff0c;尤其是后付费客户&#xff0c;风险巨大&#xff0c;造成亏损无底洞…

前端开发攻略---取消已经发出但是还未响应的网络请求

目录 注意&#xff1a; 1、Axios实现 2、Fetch实现 3、XHR实现 注意&#xff1a; 当请求被取消时&#xff0c;只会本地停止处理此次请求&#xff0c;服务器仍然可能已经接收到了并处理了该请求。开发时应当及时和后端进行友好沟通。 1、Axios实现 <!DOCTYPE html> &…

Map 双列集合根接口 HashMap TreeMap

Map接口是一种双列集合,它的每一个元素都包含一个键对象Key和值Value 键和值直接存在一种对应关系 称为映射 从Map集中中访问元素, 只要指定了Key 就是找到对应的Value 常用方法 HashMap实现类无重复键无序 它是Map 接口的一个实现类,用于存储键值映射关系,并且HashMap 集合没…

51单片机快速入门之 LED点阵 结合74hc595 的应用 2024/10/16

51单片机快速入门之 LED点阵 结合74hc595 的应用 74HC595是一种常用的数字电路芯片&#xff0c;具有串行输入并行输出的功能。它主要由两个部分组成&#xff1a;一个8位的移位寄存器和一个8位的存储寄存器。数据通过串行输入管脚&#xff08;DS&#xff09;逐位输入&#xff0…

unity Gpu优化

不一样的视角&#xff0c;深度解读unity性能优化。unity性能优化&#xff0c;unity内存优化&#xff0c;cpu优化&#xff0c;gpu优化&#xff0c;资源优化&#xff0c;资源包、资源去重优化&#xff0c;ugui优化。 gpu优化静态批处理静态批处理原理规则静态合批的原理静态合批的…

Spring Boot视频网站:安全与可扩展性设计

4 系统设计 4.1系统概要设计 视频网站系统并没有使用C/S结构&#xff0c;而是基于网络浏览器的方式去访问服务器&#xff0c;进而获取需要的数据信息&#xff0c;这种依靠浏览器进行数据访问的模式就是现在用得比较广泛的适用于广域网并且没有网速限制要求的B/S结构&#xff0c…

Appium环境搭建、Appium连接真机

文章目录 一、安装Android SDK二、安装Appium-desktop三、安装Appium Inspector 一、安装Android SDK 首先需要安装jdk&#xff0c;这里就不演示安装jdk的过程了 SDK下载地址&#xff1a;Android SDK 下载 1、点击 Android SDK 下载 -> SKD Tools 2、选择对应的版本进行下…

mysql 慢查询日志slowlog

慢查询参数 slow log 输出示例 # Time: 2024-08-08T22:39:12.80425308:00 #查询结束时间戳 # UserHost: root[root] localhost [] Id: 83 # Query_time: 2.331306 Lock_time: 0.000003 Rows_sent: 9762500 Rows_examined: 6250 SET timestamp1723127950; select *…

云栖实录 | 智能运维年度重磅发布及大模型实践解读

本文根据2024云栖大会实录整理而成&#xff0c;演讲信息如下&#xff1a; 演讲人&#xff1a; 钟炯恩 | 阿里云智能集团运维专家 张颖莹 | 阿里云智能集团算法专家 活动&#xff1a; 2024 云栖大会 AI 可观测专场 -智能运维&#xff1a;云原生大规模集群GitOps实践 2024 …

【c++】c++11多线程开发

2 C多线程 本文是参考爱编程的大丙c多线程部分内容&#xff0c;按照自己的理解对其进行整理的一篇学习笔记&#xff0c;具体一些APi的详细说明请参考大丙老师教程。 代码性能的问题主要包括两部分的内容&#xff0c;一个是前面提到资源的获取和释放&#xff0c;另外一个就是多…

使用rabbitmq-operator在k8s集群上部署rabbitmq实例

文章目录 前言一、rabbitmq-operator二、进行部署1.部署cluster-operator2.创建自己需要的特定命名空间3.创建rabbitmq的instance4.创建nodeport访问 结果验证 前言 使用rabbitmq-operator在k8s集群上部署rabbitmq实例。时区设置为上海 一、rabbitmq-operator 官网地址&#…

数学建模算法与应用 第16章 优化与模拟方法

目录 16.1 线性规划 Matlab代码示例&#xff1a;线性规划求解 16.2 整数规划 Matlab代码示例&#xff1a;整数规划求解 16.3 非线性规划 Matlab代码示例&#xff1a;非线性规划求解 16.4 蒙特卡洛模拟 Matlab代码示例&#xff1a;蒙特卡洛模拟计算圆周率 习题 16 总结…

java代码生成器集成dubbo,springcloud详解以及微服务遐想

摘要 今天终于有了点空闲时间&#xff0c;所以更新了一下代码生成器&#xff0c;修复了用户反馈的bug&#xff0c;本次更新主要增加了dubbo和springcloud脚手架的下载功能&#xff0c;架子是本人亲自搭建&#xff0c;方便自由扩展或者小白学习使用&#xff0c;你也许会问为什么…

红日安全vulnstack (二)

目录 环境搭建 网卡设置 修改Kali网段 IP 分布 WEB渗透 Weblogin服务开启 漏洞扫描 CVE工具利用 MSF上线 内网渗透 域内信息收集 凭证横向移动 权限维持 黄金票据 参考文章 https://www.cnblogs.com/bktown/p/16904232.htmlhttps://blog.csdn.net/m0_75178803/ar…

leetcode54:螺旋矩阵

给你一个 m 行 n 列的矩阵 matrix &#xff0c;请按照 顺时针螺旋顺序 &#xff0c;返回矩阵中的所有元素。 示例 1&#xff1a; 输入&#xff1a;matrix [[1,2,3],[4,5,6],[7,8,9]] 输出&#xff1a;[1,2,3,6,9,8,7,4,5]示例 2&#xff1a; 输入&#xff1a;matrix [[1,2,3,…

hackmyvm-Hundred靶机

主机发现 sudo arp-scan -l 以sudo权限执行arp-scan -l 扫描并列出本地存在的机器&#xff0c;发现靶机ip为192.168.91.153 nmap扫描 端口发现 21/tcp open ftp 22/tcp open ssh 80/tcp open http web信息收集 我们先尝试一下ftp端口的匿名登录 FTP:是文件传输协议的端…

个人博客系统_测试报告

1.项目背景 基于SSM框架实现的个人博客系统&#xff0c;由五个页面构成&#xff1a;用户登录页、博客发表页、博客编辑页、博客列表页以及博客详情页。登录即可查看自己与其他用户已发布的博客&#xff0c;也可以使用自己的账号发布博客&#xff0c;通过使用Selenium定位web元…