Search the Community
Showing results for tags 'dat'.
-
I have found a site that can create a dat file here. I don't know other scripting language and only know autoit language a bit. I'm new to this dll with autoit, can some one please translate it to autoit //WPFormat using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; namespace WP.WpFormat { public class WpFormat { [DllImport("WpFormat.dll")] public static extern System.IntPtr MRGInitDataFile(Byte bWPVersion, [MarshalAs(UnmanagedType.LPStr)] StringBuilder lpszFileName); [DllImport("WpFormat.dll")] public static extern void MRGCreateFieldNames(System.IntPtr handle, [MarshalAs(UnmanagedType.LPStr)] StringBuilder fielNames, int fieldCount); [DllImport("wpFormat.dll")] public static extern bool MRGAddField(System.IntPtr handle, [MarshalAs(UnmanagedType.LPStr)] StringBuilder lpszField); [DllImport("wpFormat.dll")] public static extern void MRGEndRecord(System.IntPtr handle); [DllImport("wpFormat.dll")] public static extern void MRGCloseDataFile(System.IntPtr handle); } } //Client Application using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; using System.IO; using WP.WpFormat; namespace WPTestApp { class Program { static void Main(string[] args) { StringBuilder fileNameSb= new StringBuilder(); fileNameSb.Append(@"c:Test.dat"); System.IntPtr handle = WpFormat.MRGInitDataFile(1, fileNameSb); StringBuilder fieldNamesSb = new StringBuilder(); fieldNamesSb.Append("Name;Contact"); WpFormat.MRGCreateFieldNames(handle, fieldNamesSb, 2); StringBuilder fieldValuesb = new StringBuilder(); fieldValuesb.Append("JOHN"); WpFormat.MRGAddField(handle, fieldValuesb); fieldValuesb=new StringBuilder(); fieldValuesb.Append("123-123-1231"); WpFormat.MRGAddField(handle, fieldValuesb); WpFormat.MRGEndRecord(handle); WpFormat.MRGCloseDataFile(handle); } } }