15,886,873 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by prajwal rao (Top 56 by date)
prajwal rao
18-Jan-13 8:24am
View
well thank you sir..... am trying to read only 4096 bytes data
prajwal rao
18-Jan-13 8:15am
View
how about this code
using System;
using System.IO;
using System.Text;
class Test
{
public static void Main()
{
string path = @"E:\\new.txt";
using (FileStream fs = File.OpenRead(path))
{
byte[] b = new byte[4096];
UTF8Encoding temp = new UTF8Encoding(true);
while (fs.Read(b, 0, b.Length) > 0)
{
Console.WriteLine(temp.GetString(b));
}
}
}
prajwal rao
18-Jan-13 7:11am
View
hmmmm ya i have visited it now sir......
can you give me a simplest method to read a file..... very short code.....
prajwal rao
18-Jan-13 6:53am
View
ya sir am using book to learn....
is there any different code to read a file other then the above code....???
prajwal rao
18-Jan-13 6:47am
View
ok...:(
prajwal rao
18-Jan-13 6:40am
View
sir its not my homework...
just am learning c# myself.....
prajwal rao
18-Jan-13 6:31am
View
ya sir i contains 4096 bits
so when we divide by 8..... its 512 bytes.....
so it contains 8 blocks of 512 bytes.....
prajwal rao
18-Jan-13 6:20am
View
sir can u edit the above code and update it please using if(!File.Exists(loadFille)
prajwal rao
18-Jan-13 6:07am
View
oh ya.....sh*t....:( where i have to specify that sir...???
prajwal rao
18-Jan-13 6:05am
View
ok sir but can you tell me how to read a file of 4096 bits...
prajwal rao
18-Jan-13 5:53am
View
sorry sir.... i am new for this language.... just learning.....:( i cant guess it...:(
prajwal rao
18-Jan-13 5:50am
View
never mind leave that point number 3..... help me to do till point number 2....please....
prajwal rao
18-Jan-13 5:48am
View
ok there is a file...... it contains so many bits of data....
1)i have to read that file
2)now i have to create each block of 4096....and then i have to give code for those blocks
3) again i have to read those block...
prajwal rao
18-Jan-13 5:32am
View
but how can i make a block 4096.. and how can i name them...???
prajwal rao
18-Jan-13 5:28am
View
ok thank you....
prajwal rao
18-Jan-13 5:27am
View
ok now i got 1 new error
Error 1 The name 'fe' does not exist in the current context
prajwal rao
18-Jan-13 5:20am
View
but where to put this code sir...
if (!File.Exists(cmdline[1]))
{
Console.WriteLine(cmdline[1] + ": file not found");
return;
}
prajwal rao
18-Jan-13 5:04am
View
Error 1 'System.IO.File': array elements cannot be of static type
Error 2 Cannot declare a variable of static type 'System.IO.File[]
Error 3 Cannot create an instance of the static class 'System.IO.Directory
Error 4 'System.IO.File' does not contain a definition for 'Length' and no extension method 'Length' accepting a first argument of type 'System.IO.File' could be found (are you missing a using directive or an assembly reference?
prajwal rao
18-Jan-13 4:54am
View
sir i want to achieve as you mentioned in your first comment....
and that code which is shown only to read a file.....
prajwal rao
18-Jan-13 3:14am
View
ok sorry....
prajwal rao
18-Jan-13 2:54am
View
ya you a right sir....
prajwal rao
18-Jan-13 2:52am
View
Deleted
i have this code but has some error
using System;
using System.IO;
class FileRead
{
string filereadbuf;
public void ReadFile(string FileName, int FileSize)
{
char[] buf = new char[FileSize];
StreamReader sr = new StreamReader(new FileStream(FileName, FileMode.Open, FileAccess.Read));
int retval = sr.ReadBlock(buf, 0, FileSize); //
Console.Write("Total Bytes Read = " + retval + "\n");
filereadbuf = new string(buf);
Console.WriteLine(filereadbuf);
sr.Close();
}
}
class TestFileRead
{
public static void Main(string[] args)
{
String[] cmdline = Environment.GetCommandLineArgs();
Console.WriteLine("File Reader Using Stream Reader & File Stream \n");
if (cmdline.Length < 2)
{
Console.WriteLine("Usage: " + cmdline[0] + " <input file> ");
return;
}
File[] fe = (new Directory(".")).GetFiles(cmdline[1]);
if (fe.Length == 0)
{
Console.WriteLine(cmdline[1] + ": file not found");
return;
}
FileRead fr = new FileRead();
try
{
fr.ReadFile(cmdline[1], (int)fe[0].Length);
}
catch (IOException e)
{
Console.WriteLine("I/O error occured" + e);
return;
}
}
}
prajwal rao
17-Jan-13 6:28am
View
:)
prajwal rao
17-Jan-13 5:10am
View
ya sure sir thank you......:)
prajwal rao
17-Jan-13 4:53am
View
well sir i don't want to sold any product....:) am just keen in learning all those things.... and just to pass my vacation am doing all those things...:)
prajwal rao
17-Jan-13 4:49am
View
thanks shiny...:) am just a beginner to this language....:)
prajwal rao
17-Jan-13 1:49am
View
thank you sir i got it...:)
prajwal rao
17-Jan-13 1:25am
View
sir i got that icofx app... what can i do wit that immage...
prajwal rao
17-Jan-13 1:24am
View
thank you Gitti and Kumar sir....:)
prajwal rao
17-Jan-13 1:12am
View
sir i got that setup file....
prajwal rao
17-Jan-13 1:11am
View
i dint get it... can u tell me clearly please.... using c sharp i have built it and published it.... so that i got application and setup file... what to do next...??
prajwal rao
16-Jan-13 23:53pm
View
if a file has some 30000 bites, and if we divide them into 8 equal parts and writing them in 8 blocks..... and cant we create a program such that if anyone tries to copy that cd rom... those data should be altered...??
prajwal rao
16-Jan-13 23:42pm
View
solution number 2.... abhinav sir got my question properly... and his solution is correct....
prajwal rao
16-Jan-13 7:19am
View
sir if anyone tries to copy then in programming by adding extra bit cant we sole that problem..???
prajwal rao
16-Jan-13 7:04am
View
sir i had written code for burning files to cd.. and now i want to protect it from copying....???
prajwal rao
16-Jan-13 2:53am
View
Thank you
prajwal rao
16-Jan-13 2:53am
View
Thanks allot sir i got it.....:)
prajwal rao
16-Jan-13 2:31am
View
sir am bad i my communication. sorry.
prajwal rao
16-Jan-13 2:22am
View
ya sir i got that bin folder and even i got that exe file. now what to do wit it...??
prajwal rao
15-Jan-13 2:05am
View
Deleted
think anything am not at all bothered....
prajwal rao
15-Jan-13 2:04am
View
What ???
prajwal rao
15-Jan-13 1:38am
View
OK thanks allot. sorry....:( am new for this site.... so i don't know any rules......:( very sorry for that....
prajwal rao
15-Jan-13 1:38am
View
Deleted
OK thanks allot. sorry....:( am new for this site.... so i don't know any rules......:( very sorry for that....
prajwal rao
15-Jan-13 1:25am
View
madam can i use the same technique to write the data to CD ROM....???
prajwal rao
15-Jan-13 1:17am
View
Deleted
well there are few people who ill help me..
if u can't help me.
then you better keep quit OK.....
prajwal rao
15-Jan-13 1:13am
View
Thank you....:)
prajwal rao
11-Jan-13 8:12am
View
i need both of them....
prajwal rao
10-Jan-13 2:52am
View
Deleted
am not a final year student..
am preparing for myself..
and by the way just check your first comment which u have done in this post....
and there are minority people's too right... so u don't take much bother about it ok.....
prajwal rao
10-Jan-13 1:15am
View
Deleted
not all people are money minded peoples like you ok....
so u better keep quit ok.... its non of your business..
prajwal rao
9-Jan-13 23:41pm
View
thank you...please provide me as quick as possible...
prajwal rao
9-Jan-13 8:00am
View
Mr.gupta sir... your link doesn't provide full program....
prajwal rao
9-Jan-13 5:20am
View
well i saw all those things.... it dint workout..:(
prajwal rao
9-Jan-13 3:06am
View
when i run that program that black screens appears and if i press enter it ill dis sapper.so that i cant c the message what it shows.:(
prajwal rao
9-Jan-13 2:45am
View
it gives some error so can u correct it..??
prajwal rao
9-Jan-13 2:06am
View
ya i tried and am working on it..??
prajwal rao
9-Jan-13 1:49am
View
ok now can u help me..??
Show More