IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası

IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası (https://www.ircforumlari.net/)
-   JavaScript (https://www.ircforumlari.net/javascript/)
-   -   Dosyadan satır satır okuma kod bloğu (https://www.ircforumlari.net/javascript/364857-dosyadan-satir-satir-okuma-kod-blogu.html)

Fonzerelli 11 Kasım 2010 14:43

Dosyadan satır satır okuma kod bloğu
 
Bir Java uygulaması acalım daha sonra bir txt dosyası olusturalım ıcıne bırseyler yazalım. Txt dosyamızı kaydedelim ve NetBeans project altında, projemizin adının bulundugu klasorun ıcıne dosyayı atalım.

Gerekli Kütüphaneler;

Kod:


import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;

Java main class ımızın içine aşağıdaki kod bloğunu yazalım;

Kod:

try
  {
  FileInputStream in = new FileInputStream("inputFile.txt");
  BufferedReader br = new BufferedReader(new InputStreamReader(in));
  String strLine;

  while((strLine = br.readLine())!= null)
  {
  System.out.println(strLine);
  }

  }catch(Exception e){
  System.out.println(e);
  }

 }

Sonuç txt içinde bulunan opengl kodlarını satır satır okumalı;

PHP- Kodu:

#include "stdafx.h"
// Bounce.c
// Demonstrates a simple animated rectangle program with GLUT
// OpenGL SuperBible, 2nd Edition
// Richard S. Wright Jr.
include <windows.h>
#include "glut.h"
// Initial square position and size
GLfloat x1 100.0f;
GLfloat y1 150.0f;
GLsizei rsize 50;
// Step size in x and y directions
// (number of pixels to move each time)
GLfloat xstep 1.0f;
GLfloat ystep 1.0f;
// Keep track of windows changing width and height
GLfloat windowWidth;
GLfloat windowHeight;
// Called to draw scene
void RenderScene(void)
{
// Clear the window with current clearing color
//
BUILD SUCCESSFUL (total time1 second



Tüm Zamanlar GMT +3 Olarak Ayarlanmış. Şuanki Zaman: 14:25.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO
Copyright ©2004 - 2025 IRCForumlari.Net Sparhawk