hai,
how to connect with tally in C#.net, and how to Export data from windows form controls to tally?
is it possible? plz help?
Answers (3)
0
Assuming there's only one GUID in each file or it's just the first one you need to match, then this is easily done using a regular expression.
Here's some sample code:
using System;
using System.IO;
using System.Text.RegularExpressions;
class Test
{
static void Main()
{
string regExp =
@"(?i)\b" +
@"[0-9A-F]{8}-" +
@"[0-9A-F]{4}-" +
@"[0-9A-F]{4}-" +
@"[0-9A-F]{4}-" +
@"[0-9A-F]{12}" +
@"\b";
string text = File.ReadAllText("darma.xml");
string guid = Regex.Match(text, regExp).Value;
Console.WriteLine(guid);
string text2 = File.ReadAllText("darma.ini");
string guid2 = Regex.Match(text2, regExp).Value;
Console.WriteLine(guid2);
if (guid == guid2)
Console.WriteLine("Files are the same");
else
Console.WriteLine("Files are not the same");
Console.ReadKey();
}
}
Accepted 0
Wonderful!!!
Thanks allot!!!