• 第七次作业


    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Reflection;
    using System.Diagnostics;


    namespace ConsoleApplication9
    {}
    class Program
    {
    Book book;
    FootBall football;

    static void Main(string[] args)
    {

    FieldInfo[] fi = typeof(Program).GetFields(BindingFlags.NonPublic | BindingFlags.Instance);
    for (int i = 0; i < fi.Length; i++)
    {
    object[] obj = fi[i].FieldType.GetCustomAttributes(typeof(PlayAttribute), false);
    if (obj != null && obj.Length > 0)
    {
    Console.WriteLine("Name:{0} Type:{1}", fi[i].Name, fi[i].FieldType);
    }
    }

    Console.Read();
    }
    }
    public class PlayAttribute : Attribute
    {
    }
    [Play]
    public class Book { }
    public class FootBall { }

    <Window x:Class="WpfApplication1.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Window1" Height="300" Width="300">
        <Grid>
            <Grid.Background>
                <LinearGradientBrush>
                    <GradientStop Offset="0" Color="Blue"></GradientStop>
                    <GradientStop Offset="0.5" Color="LightBlue"></GradientStop>
                </LinearGradientBrush>
            </Grid.Background>
            <TextBox Height="23" Margin="10,10,10,0" Name="textBox1" VerticalAlignment="Top" Text="{Binding ElementName=slider1, Path=Value, UpdateSourceTrigger=PropertyChanged}" />
            <Slider Height="21" Margin="10,40,10,0" Name="slider1" VerticalAlignment="Top" Maximum="100" />
        </Grid>
    </Window>
  • 相关阅读:
    为https请求配置ssl(不用keystore,直接用证书,rsa私钥,java代码)
    http请求对于List类型参数的处理
    java中string转ByteBuffer
    lua for循环如何从第0位开始
    lua中的cjson简单使用
    mongodb返回方便读的数据
    markdown简单插入图片
    #问题#java报Annotation processing is not supported for module cycles
    #问题#java报can't create non-static inner class instance
    git commit+push的完整步骤
  • 原文地址:https://www.cnblogs.com/zeromaiko/p/4475364.html
Copyright © 2020-2023  润新知