首页 > 其他 > 详细

常见的一些tips

时间:2015-03-30 17:49:11      阅读:230      评论:0      收藏:0      [点我收藏+]

今天算是完成了最最简略的特征矩阵提取。其实呢,就是一个与数学相关的问题,C#并没有利用到很深的地步。

1 Console.Write("{0:F2}", eigenMatrix[i][j]); //输出流的字符串格式化

但是找到了一个颇有用的东西,可以供日后慢慢研究(调整控制台窗体在屏幕中的位置):

using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;


namespace ConsoleApplication10
{
  class Program
  {
    const int SWP_NOSIZE = 0x0001;


    [DllImport("kernel32.dll", ExactSpelling = true)]
    private static extern IntPtr GetConsoleWindow();

    private static IntPtr MyConsole = GetConsoleWindow();

    [DllImport("user32.dll", EntryPoint = "SetWindowPos")]
    public static extern IntPtr SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int Y, int cx, int cy, int wFlags);

    static void Main(string[] args)
    {
      int xpos = 300;
      int ypos = 300;
      SetWindowPos(MyConsole, 0, xpos, ypos, 0, 0, SWP_NOSIZE);
      Console.WriteLine("any text");
      Console.Read();
    }
  }
}

 

常见的一些tips

原文:http://www.cnblogs.com/jingchao/p/4378270.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!