zoukankan      html  css  js  c++  java
  • WPF碎知识笔记

    1.获取当前的item在当前的Listview中的位置

                var view = ItemsControl.ItemsControlFromItemContainer(item) as ListView;

                var index = view.ItemContainerGenerator.IndexFromContainer(item);

    2.PasswordBox用法 

      <PasswordBox HorizontalAlignment="Left" Margin="205,148,0,141" Name="txtPwd" FontSize="20" Width="202" Background="Yellow" />

      // 使用一个IntPtr类型值来存储加密字符串的起始点 
      IntPtr p = System.Runtime.InteropServices.Marshal.SecureStringToBSTR(this.txtPwd.SecurePassword);
      // 使用.NET内部算法把IntPtr指向处的字符集合转换成字符串 
      string password = System.Runtime.InteropServices.Marshal.PtrToStringBSTR(p);
      info.UserPwd = password;

     

  • 相关阅读:
    自定义Response
    并发编程之进程
    并发编程知识储备
    正则表达式和re模块
    Scrapy框架
    http协议和Chrome抓包工具
    requests库
    Beautifulsoup
    xpath
    Mysql一些操作
  • 原文地址:https://www.cnblogs.com/forgetme/p/2648828.html
Copyright © 2011-2022 走看看