vc.net 实现数据结构操作

Android WebView安全浏览机制解析:从412错误处理到跨平台实践 WebView作为移动应用加载网页内容的核心组件,其安全性直接关系到用户数据与应用生态的稳定。安全浏览(Safe Browsing)机制通过实时比对恶意网址数据库,为WebView提供了一道基础防线,其原理涉及本地缓存查询与实时API检查。这项技术的核心价值在于主动防御网络钓鱼、恶意软件等客户端攻击,是满足应用商店合规要求、保护用户隐私的必备实践。在Android开发中,开发者常因网络波动或配置问题遭遇“412 Precondition Failed”错误,这实质是安全裁决流程未能完成所致,需通过WebVi 阅读详情

// VCPro1.cpp :Algorithm in the course of data structure
//Author: Acefly
//Date: 2008/12/26
#include "stdafx.h"
#include   <iostream>  
using   namespace   std;

// Define the struct node for lineList
#define InitLineListSize 100
  typedef struct
 {
   int * baseAddress;
   int length;
   int initialSize;
 } LineList,*PLineList;

// Define the struct node for linkList
   struct node
   {
  int data;
  struct node * next;
   };

// Function declaration
 void CreateLineList(LineList lineList);
 void InsertDataIntoLineList(int *lineList,int length,int insertLocation,int lineListData);
 void DeleteDataFromLineList(int *ineList,int length,int deleteLocation);
 int  SearchDataFromLineList(int *LineList,int length,int searchData);
 void DisplayAllDataInTheLineList(int *LineList,int length);
 void ExitFromProgram();
 void InsertDataIntoLinkList(struct node* linkNodes,int insertLocation,int linkListData);
 void DisplayDataInLinkList(struct node* linkNodes);
 void DeleteDataFromLinkList(struct node* linkList,int deleteLocation);
 void SearchDataFromLinkList(struct node* linkList,int searchLocation); 

/// <summary>
/// Main function
/// </summary>
int _tmain(int argc, _TCHAR* argv[])
{
 //the series number for operation of the platform.
 int num;
 //define an lineList object
 LineList lineList;
 //create the lineList.
    lineList.baseAddress=(int *)malloc(InitLineListSize*sizeof(lineList));
  if(!lineList.baseAddress)
  {
   cout <<"Initial lineList failed.";
   exit(0);
  }
  else
  {
   lineList.length=0;
   lineList.initialSize=InitLineListSize;
  }

 // build the linkList
 struct node* linkNodes = (struct node *)malloc(sizeof(struct node));
 linkNodes->next=NULL;

  //build the user interface.
  cout << "DataStructure testing platform"<<endl;
  cout << "1: Insert data into the lineList" <<endl;
  cout << "2: Delete data from lineList" <<endl;
  cout << "3: Search data from lineList" <<endl;
  cout << "4: Add data to the linkList"<<endl;
  cout << "5: Delete data from the linkList"<<endl; 
  cout << "6: Search data from the linkList"<<endl;
  cout << "" << endl;
  cout << "100: Exit" << endl;
  cout << "***************************************"<<endl;
  cout << "Please make your choice (1,2,3,4,5,6)" <<endl;
 
  cin >> num;

  //verify the input series number.
  while(num!=1&&num!=2&&num!=3&&num!=4&&num!=5&&num!=6&&num!=100)
  {
   cout << "You have input the wrong series number,please input it again:"<<endl;
   cin >> num;
  }
 do
 {
  switch(num)
  {
  case 1 :
     {
      int insertLocation;
      int lineListData;
      cout << "Please input the insert location:(the length of the current lineList is "<<lineList.length<<") "<<endl;
      cin >> insertLocation;
      while(insertLocation<0||insertLocation>lineList.length)
      {
       cout << "you can't insert data here ,Please input again:"<<endl;
       cin >> insertLocation;
      }
      cout << "Please intput the insert data:"<<endl;
      cin >>lineListData;
      InsertDataIntoLineList(lineList.baseAddress,lineList.length, insertLocation,lineListData);
      lineList.length++;

   //Display all data in the lineList
   DisplayAllDataInTheLineList(lineList.baseAddress,lineList.length);
      break;
     }
  case 2 :
     {  
      int deleteLocation;
      cout << "Please input series number of the data you want to delete"<<endl;
      cin >> deleteLocation;
      while(deleteLocation < 0||deleteLocation > lineList.length)
      {
       cout << "The data is not exist,please input again:"<<endl;
       cin >> deleteLocation;
      }
      DeleteDataFromLineList(lineList.baseAddress,lineList.length,deleteLocation);
      lineList.length--;

   //Display all data in the lineList
   DisplayAllDataInTheLineList(lineList.baseAddress,lineList.length);
      break;
     }
  case 3 :
     {
      int searchData;
      int dataLocation;
      cout << "Please input the data you want to search" <<endl;
      cin >> searchData;
      dataLocation=SearchDataFromLineList(lineList.baseAddress,lineList.length,searchData);
      if(dataLocation)
      {
       cout << "The number of the data you want is : " << dataLocation << endl;
      }
      else
      {
       cout << "The data you search is not in the lineList" <<endl;
      }

   //Display all data in the lineList
   DisplayAllDataInTheLineList(lineList.baseAddress,lineList.length);
      break;
     }
  case 100 :
     {
      ExitFromProgram();
      break;
     }
  case 4:
   {
    //Insert node to the linkList
    int insertLocation;
    int linkListData;
    cout << "Please input the insert location:"<<endl;
    cin >> insertLocation;
    cout << "Please intput the insert data:"<<endl;
    cin >> linkListData;
    InsertDataIntoLinkList(linkNodes,insertLocation,linkListData);

    //Display all data in the linkList
    DisplayDataInLinkList(linkNodes);
    break;
   }
  case 5:
   {
    //Delete node from the linkList
    int deleteLocation;
    cout << "Please input series number of the data you want to delete"<<endl;
    cin >> deleteLocation;
    DeleteDataFromLinkList(linkNodes,deleteLocation);

    //Display all data in the linkList
    DisplayDataInLinkList(linkNodes);
    break;

   }
  case 6:
   {
    //Search node from the linkList
    int searchLocation;
    int result;
    cout << "Please input series number of the data you want to search"<<endl;
    cin >> searchLocation;
    SearchDataFromLinkList(linkNodes,searchLocation);
   
    //Display all data in the linkList
    DisplayDataInLinkList(linkNodes);
    break;

   }
  default: break;
  }
 
  cout << "LineList function testing platform"<<endl;
  cout << "1: Insert data into the lineList" <<endl;
  cout << "2: Delete data from lineList" <<endl;
  cout << "3: Search data from lineList" <<endl;
  cout << "4: Add data to the linkList"<<endl;
  cout << "5: Delete data from the linkList"<<endl; 
  cout << "6: Search data from the linkList"<<endl; 
  cout << "100: Exit" << endl;
  cout << "***************************************"<<endl;
  cin >>num;
  //verify the input data.
  while(num!=1&&num!=2&&num!=3&&num!=4&&num!=5&&num!=6&&num!=100)
  {
   cout << "you have input the wrong number";
   cin >> num;
  }
 }while(num!=100);
}

 


/// <summary>
/// Insert data into the lineList.
/// </summary>
void InsertDataIntoLineList(int *lineList,int length,int insertLocation,int lineListData)
{
 for(int i=length-1;i>=insertLocation;i--)
 {
  *(lineList+i+1)=*(lineList+i); 
 }
 *(lineList+insertLocation)=lineListData;
}

/// <summary>
/// Insert data into the linkList.
/// </summary>
void InsertDataIntoLinkList(struct node* linkNodes,int insertLocation,int lineListData)
{
 struct node* p=linkNodes;
 struct node* Node = (struct node*)malloc(sizeof(struct node));
 Node->data = lineListData;

 for(int i =0 ;i< insertLocation-1 && p->next!=NULL;i++)
 {
  p = p->next;
 }
 Node->next=p->next;
 p->next=Node;
}

/// <summary>
/// Search data in the linkList.
/// </summary>
void SearchDataFromLinkList(struct node* linkNodes,int searchLocation)
{
 int length=0;
 struct node* p=linkNodes;
 struct node* q=linkNodes;
 while(p!=NULL)
 {
  p=p->next;
  length++;
 }
 if(searchLocation > length || searchLocation < 0)
 {
  cout << "The data is not exist in the linkList";
 }
 else
 {
  for(int i=0;i < searchLocation;i++)
  {
   q=q->next;
  }
  cout << "The data you search is: ";
  cout << q->data<<"/n";
 }
}

/// <summary>
/// Insert data into the linkList.
/// </summary>
void DisplayDataInLinkList(struct node* linkNodes)
{
 cout << "The data in the linkList are :";
 linkNodes=linkNodes->next;
 while(linkNodes!=NULL)
 {
  cout << linkNodes->data << " ";
  linkNodes=linkNodes->next;
 }
 cout << "/n";
}

/// <summary>
/// Delete data from the lineList.
/// </summary>
void DeleteDataFromLineList(int *lineList,int length,int deleteLocation)
{
  for(int i=deleteLocation-1;i<length;i++)
  {
     *(lineList+i)=*(lineList+i+1);
  }
}

/// <summary>
/// Delete data from the linkList.
/// </summary>
void DeleteDataFromLinkList(struct node *linkList,int deleteLocation)
{
 struct node* p=linkList;
 struct node* q;
 for(int i =1 ;i< deleteLocation && p->next!=NULL;i++)
 {
  p=p->next;
 }
 q=p->next;
 p->next=q->next;
 delete(q);
}

/// <summary>
/// Search data in the linelist.
/// </summary>
int SearchDataFromLineList(int *lineList,int length,int searchData)
{
 for(int i=0;i<length;i++)
 {
  if(*(lineList+i)==searchData)
  {
   return i+1;
  }
 }
 return 0;
}

///<summary>
///display all data in the lineList.
///<summary>
void DisplayAllDataInTheLineList(int *LineList,int length)
{
 if(LineList)
 {
  cout << "The data in the current lineList are :" <<endl;
  for(int i=0;i<length;i++)
  {
    cout << *(LineList+i)<<"  ";
  }
  cout << endl;
 }
}

///<summary>
///exit from the system.
///<summary>
void ExitFromProgram()
{
 exit(0);
}

 

Visual C++ .NET 开发实例完全剖析 我前几天下的 感觉不错 可以供大家学习 呵呵 希望我们能够一起进步 我是开始学 也希望大家指点 立即下载

相关推荐

Vc编写数据结构

VC++和数据结构都是很基础,这个文档用VC++编写数据结构

VC 一些操作数据库相关实例源代码.rar

VC 操作数据库的一些实用例子,比如使用DAO读写Access文件、OLE查看器、Oracle数据库连接实例、SQL查询分析器、读写DBF文件、浏览数据库的程序等,有些较简单,有些挺复杂,适合不同层次的Vc 编程者阅读参考。

滑动窗口协议C++代码

滑动窗口协议C++代码

WebView中shouldOverrideUrlLoading和onPageStarted方法的区别

WebView中的shouldOverrideUrlLoading和onPageStarted这两个方法就是可以捕获到跳转的url,然后进行一系列的操作,但是他们两到底有什么区别呢? 当点击页面中的链接的时候他们俩都会执行,但是返回到上一个页面的时候onPageStarted会执行,但是shouldOverrideUrlLoading就不执行了,就是onPageStarted什么时候都执...

weixin_30500105的博客 377

学徒浅析Android开发:杂谈——WebView的url跳转时方法执行顺序

在实际项目开发中,我们用到WebView的场景,大多是在对接协议、第三方应用或网页时出现。对于页面加载,WebView没有自带等待效果。所以,需要我们去自定义各种带进度条的WebView,网上相关的例子也是不胜枚举,今天我们就来谈谈一条地址请求在WebView中的跳转问题: WebView中有两个工具类负责管理网页各种行为:WebChromeClient和WebViewClient。分别通过se

lz8362的专栏 6104

WebView页面跳转

转自:微点阅读 https://www.weidianyuedu.com 导读 在实际项目开发中,我们用到WebView的场景,大多是在对接协议、第三方应用或网页时出现。对于页面加载,WebView没有自带等待效果。所以,需要我们去自定义各种带进度条的WebView,网上相关的例子也是不胜枚举,今天我们就来谈谈一条地址请求在WebView中的跳转问题: WebView中有两个工具类负责管理网页各种行为:WebChromeClient和WebViewClient。分别通过setWebChr...

ysds20211402的博客 791

WebView的url跳转时方法执行顺序

在实际项目开发中,我们用到WebView的场景,大多是在对接协议、第三方应用或网页时出现。对于页面加载,WebView没有自带等待效果。所以,需要我们去自定义各种带进度条的WebView,网上相关的例子也是不胜枚举,今天我们就来谈谈一条地址请求在WebView中的跳转问题: WebView中有两个工具类负责管理网页各种行为:WebChromeClient和WebViewClient。分别通过set...

匿名的博客 2179

谈谈WebView的页面跳转

转载自品略图书馆http://www.pinlue.com/article/2020/03/2610/4610055560620.html 简介 在实际项目开发中,我们用到WebView的场景,大多是在对接协议、第三方应用或网页时出现。对于页面加载,WebView没有自带等待效果。所以,需要我们去自定义各种带进度条的WebView,网上相关的例子也是不胜枚举,今天我们就来谈谈一条地址请...

yihuliunian的博客 1344

关于地址请求在WebView中的跳转问题

转自:微点阅读 https://www.weidianyuedu.com在实际项目开发中,我们用到WebView的场景,大多是在对接协议、第三方应用或网页时出现。对于页面加载,WebView没有自带等待效果。所以,需要我们去自定义各种带进度条的WebView,网上相关的例子也是不胜枚举,今天我们就来谈谈一条地址请求在WebView中的跳转问题:WebView中有两个工具类负责管理网页各种行为:WebChromeClient 和 WebViewClient。分别通过 setWebChromeClient()

xiaoweids的博客 510

WebView的页面跳转浅谈

转自:微点阅读https://www.weidianyuedu.com 在实际项目开发中,我们用到WebView的场景,大多是在对接协议、第三方应用或网页时出现。对于页面加载,WebView没有自带等待效果。所以,需要我们去自定义各种带进度条的WebView,网上相关的例子也是不胜枚举,今天我们就来谈谈一条地址请求在WebView中的跳转问题: WebView中有两个工具类负责管理网页各种行为:WebChromeClient和WebViewClient。分别通过setWebChromeCl...

ysds20211402的博客 864

webview的页面跳转

在现在的安卓开发中,很多应用都内嵌了H5网页,比如淘宝,携程等app。使用混合式开发可以在不更新版本的情况下更新app内容,对企业来说也可以节约开发成本,既可以在安卓中使用,也可以在apple中使用。 WebView中有两个工具类负责管理网页各种行为:WebChromeClient和WebViewClien t,分别通过 setWebChromeClient() 和 setWebViewCl

shuaiyou_comon的博客 6436

WebView使用详解之WebViewClient的常用事件监听

1、WebViewClient与WebChromeClient的区别简单的说,setWebChromeClient比setWebViewClient功能强大一些:WebViewClient主要帮助WebView处理各种通知、请求事件的,比如:onLoadResourceonPageStartonPageFinishonReceiveErroronReceivedHttpAuthRequestWeb...

沧海龙腾LV的博客 1095

WebView WebViewClient 拦截URL在华为6.0与其他版本上的兼容区别

前提: 最近在项目中碰到 WebViewClient 的 shouldOverrideUrlLoading 方法,在部分机型中失效情况。(项目中使用的是 WebView封装框架–AgentWeb) 问题:调用 WebViewClient 的 shouldOverrideUrlLoading(WebView view, WebResourceRequest request) 方法时,在 安卓5.1...

主营Android,副营Flutter、前端 1962

realm android 回调,一个例子让我理解WebViewClient各方法重写的作用

摘要:创建并设置一个WebViewClient子类,回调对应的方法改变网页内容的呈现方式,比如:网页加载错误回调onReceivedError(),提交表单错误回调onFormResubmission(),拦截URL加载回调shouldOverrideUrlLoading()方法,判断是否加载同一条url回调onPageStarted(),处理一个HTTP认证请求回调onReceivedHttpA...

weixin_35727143的博客 415

WebViewClient

WebViewClient主要帮助WebView处理各种通知、请求事件的,比如: onLoadResource onPageStart 网页开始加载 onPageFinish 网页加载完毕 onReceiveError 接收出错 onReceivedHttpAuthRequest W...

浪漫之圣 540
上一篇: 程序员的培养
下一篇: 求最大公共子串
acefly
博客等级 码龄19年 3粉丝 14原创
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值