10 TIPs - To Become a Good Developer/Programmer
Why Join
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
As Ak
2.1k
65
3.6k
Check varbinary data
Nov 8 2020 8:13 PM
I have to check the values of varbinary data in the text file. For example, in the text file, if the start range is 1100, while the end range is 10FF, it will continue to do the next process, else it will prompt the range is not meet the end range yet.
This is my current code:
var data = File
.ReadAllLines(Path)
.Select(x => x.Split(
'='
))
.Where(x => x.Length > 1)
.ToDictionary(x => x[0].Trim(), x => x[1]);
Console.WriteLine(
"Start: {0}"
, data[
"Start"
]);
Console.WriteLine(
"End: {0}"
, data[
"End"
]);
if
(data[
"Start"
] == data[
"End"
]+1)
{
//it will proceed to next process
}
else
{
//prompt not meet end range
}
This is the text file
The problem is, the if (data["Start"] == data["End"]+1) does not functioning. any other method that I can do?
Reply
Answers (
2
)
How to check if a file is in use without throwing exception using C# e
how to convert its first character to upper