カテゴリー
Wiki内検索
*
最近更新したページ
最新コメント
win32/guitest by stunning seo guys
FrontPage by stunning seo guys
SWIG by awesome things!
Win32/Console by stunning seo guys
FrontPage by awesome things!
Win32SDK_ICM by stunning seo guys
Win32SDK_MM by check it out
Win32SDK_process by stunning seo guys
VisualuRuby by stunning seo guys

Win32/Console

See

RAA - win32_console
http://raa.ruby-lang.org/project/win32_console/

Sample


require 'Win32/Console'
require 'net/http'
 
h = Net::HTTP.new('members.at.infoseek.co.jp')
h.request_get('/hken/eplib1/er_ep.htm') { |res|
  res.each { |k, v|
    puts k + ": " + v
  }
  content_length = res['content-length'].to_i
  read_size = 0
  console = Win32::Console.new(STD_OUTPUT_HANDLE)
  cursor = console.Cursor
  res.read_body do |segment|
    read_size += segment.size
    console.Cursor(*cursor)
    puts "#{read_size * 100 / content_length}%"
  end
}
2006年03月11日(土) 03:54:42 Modified by aqualung




スマートフォン版で見る