using System; using System.IO; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; namespace testnew2 { public class FileHandler { [DllImport( "kernel32.dll", CharSet = CharSet.Auto )] public static extern int GetShortPathName( [MarshalAs( UnmanagedType.LPTStr )] string path, [MarshalAs( UnmanagedType.LPTStr )] StringBuilder shortPath, int shortPathLength ); static void WriteToFile() { StreamWriter SW; SW = File.CreateText( "c:\\MyTextFile.txt" ); SW.WriteLine( "God is greatest of them all" ); SW.WriteLine( "This is second line" ); //här vill jag placera in textfilnamn SW.Close(); Console.WriteLine( "File Created SucacessFully" ); } } } //dina grejer.... ArrayList minLista = new ArrayList(); for(int i=0;i