15,902,447 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 Mrunal Sonawane (Top 20 by date)
Mrunal Sonawane
6-Nov-17 11:19am
View
But you can try one thing... hide the scrollbar of ListBox and put the RTB on the right hand side so that you have only one scrollbar visible.
Mrunal Sonawane
3-Nov-17 9:56am
View
Sorry but I tried to paste the code here and it is too long to be displayed... That is why I added a link... Should I paste it on paste bin?
Mrunal Sonawane
2-Nov-17 15:11pm
View
No worries :D
Mrunal Sonawane
2-Nov-17 15:09pm
View
Lol nice... I might take sometime to reply via mail but I always do check my mail so feel free to mail me any problems you face! Always happy to help! :D
Mrunal Sonawane
2-Nov-17 15:05pm
View
No problem bro! :D
Mrunal Sonawane
2-Nov-17 15:03pm
View
Deleted
Sure... mrunal.s15@gmail.com... Save it and then tell me I need to delete it from here... Lol
Mrunal Sonawane
2-Nov-17 14:46pm
View
No worries bro... Coding is really interesting... And trying to solve problems related to it feels nice!
Well, you can try increasing the thread sleep time... to like 1000 or 2000 or even more... Maybe that might help... Please let me know
Actually the thing is that the function is doing a lot of work... Creating objects, reading files, hashing etc etc... Which is adding on to the usage... Well, try increasing the time and tell me if it does anything at all...
Mrunal Sonawane
2-Nov-17 14:40pm
View
Thinking...
Mrunal Sonawane
2-Nov-17 14:39pm
View
Hmm...
Mrunal Sonawane
2-Nov-17 14:35pm
View
Sure... Let me know...
Mrunal Sonawane
2-Nov-17 14:34pm
View
For Each hashByte In hash
buff.Append(String.Format("{0:X2}", hashByte))
Thread.Sleep(500)
Next
Mrunal Sonawane
2-Nov-17 14:34pm
View
change those lines in your code
Mrunal Sonawane
2-Nov-17 14:33pm
View
For Each hashByte In hash
buff.Append(String.Format("{0:X2}", hashByte))
Thread.Sleep(500)
Next
...
Try this maybe
Mrunal Sonawane
2-Nov-17 14:27pm
View
Yeah sure it is using the cpu... but commenting it is not a good choice... It will create more errors than fix any...
Mrunal Sonawane
2-Nov-17 14:23pm
View
He is saying that put your code in comment...
'This is a comment... Lol
Mrunal Sonawane
2-Nov-17 14:22pm
View
xD
Mrunal Sonawane
2-Nov-17 14:18pm
View
Feel free to ask me something you don't understand... :D
Mrunal Sonawane
2-Nov-17 13:18pm
View
Need to get the structure of the database... Please give some information about the database... Picture of the table... etc etc... So that I can recreate the table and try to write a code for it...
Mrunal Sonawane
2-Nov-17 11:57am
View
Deleted
I guess the FileOpen is not complete in the previous comment... Here it is
private bool FileOpen (bool binary_encoding, Encoding use_encoding, string original_filename)
{
int i;
string s;
string filename = Path.GetFullPath (original_filename);
if (!File.Exists (filename))
{
Messagebox.Show ("File does not exist!\r\n\r\n" + filename);
return true;
}
// refuse to open a file with a backup extension of 1, 2, or 3.
s = Path.GetExtension (filename);
if (s == ".1" || s == ".2" || s == ".3")
{
Messagebox.Show ("Cannot open a backup file!\r\n\r\n" + filename);
return true;
}
if (!ReadOnly)
{
s = null;
try
{
file_stream = new FileStream (filename, FileMode.Open, FileAccess.ReadWrite, FileShare.Read);
backup = true;
}
catch (Exception err)
{
s = err.Message;
}
if (null != s)
{
// we don't do read-only in automation
if (automation)
return true;
s += " Open read-only?";
DialogResult code = Warning_Popup (s);
if (DialogResult.Cancel == code)
return true;
ReadOnly = true;
}
}
if (ReadOnly)
{
s = null;
try
{
file_stream = new FileStream (filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
}
catch (Exception err)
{
s = err.Message;
}
if (null != s)
{
Messagebox.Show (s);
return true;
}
}
if (file_stream.Length > SI.ParseI32 ("2M"))
{
s = "File size is about " + SI.ToString (file_stream.Length)
+ "! While it may possible to edit a file of this size, it will be slow.";
if (DialogResult.Cancel == Warning_Popup (s))
{
NewAll (false);
return true;
}
}
StreamReader sr;
// is it forced encoding?
if (null == use_encoding)
// automatic attempt UTF-8 encoding with ANSI error exception, BOM detect
sr = new StreamReader (file_stream, Encode (Encodes.UTF_8_ASCII), true);
else
sr = new StreamReader (file_stream, use_encoding, false);
Cursor.Current = Cursors.WaitCursor;
s = null;
try
{
// fast part for big files
s = sr.ReadToEnd ();
UpdateEncoding (sr.CurrentEncoding);
}
catch
{
// ANSI error detection
s = null;
}
if (s == null && file_stream.Position > 0)
{
// use ANSI
UpdateEncoding (Encode (Encodes.ANSI));
file_stream.Position = 0;
sr = new StreamReader (file_stream, saved_encoding);
s = sr.ReadToEnd ();
}
if (ReadOnly)
sr.Close ();
else
// don't close or dispose because it closes the underlying file_stream
sr.DiscardBufferedData ();
// binary data from file
byte[] file_bytes = null;
// did they force binary?
if (binary_encoding)
{
file_bytes = saved_encoding.GetBytes (s);
UpdateEncoding (Encode (Encodes.Binary));
}
// is the encoding automatic and ambiguous and contains NUL?
else if ((null == use_encoding) && (0 == saved_encoding.GetPreamble ().Length) && (0 <= s.IndexOf ("\x0")))
{
// ANSI and UTF-8 ASCII do not change bytes so no need to reread
file_bytes = saved_encoding.GetBytes (s);
// we are interested in the last two bytes
i = file_bytes.Length - 2;
// tentative assume binary for ANSI
if (Encodes.ANSI == saved_encoding_enum)
saved_encoding_enum = Encodes.Binary;
// Unicode requires an even nmber of bytes
if (0 == (i & 1))
{
if ('\n' == file_bytes[i] && '\x0' == file_bytes[i + 1])
{
if (TestEncode (Encode (Encodes.Unicode), file_bytes))
s = base_read_encodings[3].GetString (file_bytes);
}
else if ('\x0' == file_bytes[i] && '\n' == file_bytes[i + 1])
{
if (TestEncode (Encode (Encodes.Unicode_Big_Endian), file_bytes))
s = base_read_encodings[4]
Mrunal Sonawane
2-Nov-17 11:56am
View
That is the exact error and what happens due to that is that all New line characters (if you can say that) get deleted and it is all clubbed in a single line... What I want is to get the text with the line breaks...
Here is the code.. If it helps...
And... The CR/LF message is a part of the FileOpen()
FileOpen: https://drive.google.com/open?id=0B1X1ZXWTGolWQldhZEJRMkJZOGc
FileSave: https://drive.google.com/open?id=0B1X1ZXWTGolWb0tSbVl0cklBOTg
Show More