تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
هل يمكن قراءة ملف txt من موقع
#1
هل يمكن قراءة ملف txt من موقع مثل vb.net & C# ?
الرد }}}
تم الشكر بواسطة:
#2
نعم ممكن بهذا الشكل
PHP كود :
TextBox1.Text System.IO.File.ReadAllText("C:\test.txt"
سبحان الله والحمدلله ولا إله إلا الله والله أكبر
 اللهم اغْفِرْ لِلمؤمنين والمؤمنات والمسلمين والمسلمات الأحياء منهم والأموات
الرد }}}
تم الشكر بواسطة: Mohamed20
#3
(14-09-16, 11:45 AM)أبو عمر كتب :
نعم ممكن بهذا الشكل
PHP كود :
TextBox1.Text System.IO.File.ReadAllText("C:\test.txt"

لاكن هذا بلغة vb.et و ليس c++
الرد }}}
تم الشكر بواسطة:
#4
آآآآآآآآآآآآآسف جداً
PHP كود :
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <string>
using namespace std;
 
int main() {
   
string filename "test.txt";
 
   
// Write to File
   
ofstream fout(filename.c_str());  // default mode is ios::out | ios::trunc
   
if (!fout) {
      
cerr << "error: open file for output failed!" << endl;
      
abort();  // in <cstdlib> header
   
}
   
fout << "apple" << endl;
   
fout << "orange" << endl;
   
fout << "banana" << endl;
   
fout.close();
 
   
// Read from file
   
ifstream fin(filename.c_str());  // default mode ios::in
   
if (!fin) {
      
cerr << "error: open file for input failed!" << endl;
      
abort();
   }
   
char ch;
   while (
fin.get(ch)) {  // till end-of-file
      
cout << ch;
   }
   
fin.close();
   return 
0;


ظننت المشاركة في قسم VB
سبحان الله والحمدلله ولا إله إلا الله والله أكبر
 اللهم اغْفِرْ لِلمؤمنين والمؤمنات والمسلمين والمسلمات الأحياء منهم والأموات
الرد }}}
تم الشكر بواسطة: Mohamed20 , Mohamed20
#5
(15-09-16, 12:07 AM)أبو عمر كتب : آآآآآآآآآآآآآسف جداً
PHP كود :
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <string>
using namespace std;
 
int main() {
 
  string filename "test.txt";
 
 
  // Write to File
 
  ofstream fout(filename.c_str());  // default mode is ios::out | ios::trunc
 
  if (!fout) {
 
     cerr << "error: open file for output failed!" << endl;
 
     abort();  // in <cstdlib> header
 
  }
 
  fout << "apple" << endl;
 
  fout << "orange" << endl;
 
  fout << "banana" << endl;
 
  fout.close();
 
 
  // Read from file
 
  ifstream fin(filename.c_str());  // default mode ios::in
 
  if (!fin) {
 
     cerr << "error: open file for input failed!" << endl;
 
     abort();
 
  }
 
  char ch;
 
  while (fin.get(ch)) {  // till end-of-file
 
     cout << ch;
 
  }
 
  fin.close();
 
  return 0;


ظننت المشاركة في قسم VB
جزاك الله خير
الرد }}}
تم الشكر بواسطة:



التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم