2011-09-14 10:31:00 -03:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.IO;
|
2011-11-29 09:49:11 -04:00
|
|
|
|
using System.Net;
|
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
using ICSharpCode.SharpZipLib.Zip;
|
|
|
|
|
using System.Threading;
|
2012-04-30 07:48:52 -03:00
|
|
|
|
using System.Collections;
|
2011-09-14 10:31:00 -03:00
|
|
|
|
|
|
|
|
|
namespace ArdupilotMega
|
|
|
|
|
{
|
|
|
|
|
class srtm
|
|
|
|
|
{
|
2012-05-13 07:56:42 -03:00
|
|
|
|
public static string datadirectory = "./srtm/";
|
2011-09-14 10:31:00 -03:00
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
static List<string> allhgts = new List<string>();
|
|
|
|
|
|
|
|
|
|
static object objlock = new object();
|
|
|
|
|
|
|
|
|
|
static Thread requestThread;
|
|
|
|
|
|
|
|
|
|
static List<string> queue = new List<string>();
|
|
|
|
|
|
2012-05-13 07:56:42 -03:00
|
|
|
|
static Hashtable fnamecache = new Hashtable();
|
|
|
|
|
|
|
|
|
|
static Hashtable filecache = new Hashtable();
|
2012-04-30 07:48:52 -03:00
|
|
|
|
|
2012-09-30 20:53:54 -03:00
|
|
|
|
static Dictionary<string, short[,]> cache = new Dictionary<string, short[,]>();
|
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
public static int getAltitude(double lat, double lng, double zoom)
|
2011-09-14 10:31:00 -03:00
|
|
|
|
{
|
2011-10-04 08:19:25 -03:00
|
|
|
|
short alt = 0;
|
2011-09-14 10:31:00 -03:00
|
|
|
|
|
2012-09-30 20:53:54 -03:00
|
|
|
|
//lat += 1 / 1199.0;
|
2012-05-13 07:56:42 -03:00
|
|
|
|
//lng -= 1 / 1201f;
|
2012-04-30 07:48:52 -03:00
|
|
|
|
|
2012-05-13 07:56:42 -03:00
|
|
|
|
// lat -35.115676879882812 double
|
|
|
|
|
// lng 117.94178754638671 double
|
|
|
|
|
// alt 70 short
|
2012-04-30 07:48:52 -03:00
|
|
|
|
|
2012-09-30 20:53:54 -03:00
|
|
|
|
int x = (lng < 0) ? (int)(lng-1) : (int)lng;//(int)Math.Floor(lng);
|
|
|
|
|
int y = (lat < 0) ? (int)(lat - 1) : (int)lat; ;//(int)Math.Floor(lat);
|
2011-09-14 10:31:00 -03:00
|
|
|
|
|
|
|
|
|
string ns;
|
|
|
|
|
if (y > 0)
|
|
|
|
|
ns = "N";
|
|
|
|
|
else
|
|
|
|
|
ns = "S";
|
|
|
|
|
|
|
|
|
|
string ew;
|
|
|
|
|
if (x > 0)
|
|
|
|
|
ew = "E";
|
|
|
|
|
else
|
|
|
|
|
ew = "W";
|
|
|
|
|
|
2012-05-13 07:56:42 -03:00
|
|
|
|
if (fnamecache[y] == null)
|
|
|
|
|
fnamecache[y] = Math.Abs(y).ToString("00");
|
|
|
|
|
if (fnamecache[1000 + x] == null)
|
|
|
|
|
fnamecache[1000 + x] = Math.Abs(x).ToString("000");
|
2011-09-17 10:22:07 -03:00
|
|
|
|
|
2012-05-13 07:56:42 -03:00
|
|
|
|
string filename = ns + fnamecache[y] + ew + fnamecache[1000 + x] + ".hgt";
|
2011-09-17 10:22:07 -03:00
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
try
|
|
|
|
|
{
|
2011-09-17 10:22:07 -03:00
|
|
|
|
|
2012-09-30 20:53:54 -03:00
|
|
|
|
if (cache.ContainsKey(filename) || File.Exists(datadirectory + Path.DirectorySeparatorChar + filename))
|
2011-11-29 09:49:11 -04:00
|
|
|
|
{ // srtm hgt files
|
2012-05-13 07:56:42 -03:00
|
|
|
|
|
2012-09-30 20:53:54 -03:00
|
|
|
|
int size = -1;
|
2011-11-29 09:49:11 -04:00
|
|
|
|
|
2012-09-30 20:53:54 -03:00
|
|
|
|
if (!cache.ContainsKey(filename))
|
2011-11-29 09:49:11 -04:00
|
|
|
|
{
|
2012-09-30 20:53:54 -03:00
|
|
|
|
FileStream fs = new FileStream(datadirectory + Path.DirectorySeparatorChar + filename, FileMode.Open, FileAccess.Read, FileShare.Read);
|
2011-11-29 09:49:11 -04:00
|
|
|
|
|
2012-09-30 20:53:54 -03:00
|
|
|
|
if (fs.Length == (1201 * 1201 * 2))
|
|
|
|
|
{
|
|
|
|
|
size = 1201;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
size = 3601;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
byte[] altbytes = new byte[2];
|
|
|
|
|
short[,] altdata = new short[size, size];
|
2011-11-29 09:49:11 -04:00
|
|
|
|
|
|
|
|
|
|
2012-09-30 20:53:54 -03:00
|
|
|
|
int altlat = 0;
|
|
|
|
|
int altlng = 0;
|
2011-11-29 09:49:11 -04:00
|
|
|
|
|
2012-09-30 20:53:54 -03:00
|
|
|
|
while (fs.Read(altbytes, 0, 2) != 0)
|
|
|
|
|
{
|
|
|
|
|
altdata[altlat, altlng] = (short)((altbytes[0] << 8) + altbytes[1]);
|
2011-11-29 09:49:11 -04:00
|
|
|
|
|
2012-09-30 20:53:54 -03:00
|
|
|
|
altlat++;
|
|
|
|
|
if (altlat >= size)
|
|
|
|
|
{
|
|
|
|
|
altlng++;
|
|
|
|
|
altlat = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-11-29 09:49:11 -04:00
|
|
|
|
|
2012-09-30 20:53:54 -03:00
|
|
|
|
fs.Close();
|
|
|
|
|
|
|
|
|
|
cache[filename] = altdata;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (cache[filename].Length == (1201 * 1201))
|
|
|
|
|
{
|
|
|
|
|
size = 1201;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
size = 3601;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int posx = 0;
|
|
|
|
|
int row = 0;
|
2011-11-29 09:49:11 -04:00
|
|
|
|
|
2012-09-30 20:53:54 -03:00
|
|
|
|
posx = (int)(((float)(lng - x)) * (size * 1));
|
|
|
|
|
row = (int)(((float)(lat - y)) * (size * 1));
|
|
|
|
|
row = size - row;
|
2012-04-30 07:48:52 -03:00
|
|
|
|
|
2012-09-30 20:53:54 -03:00
|
|
|
|
return cache[filename][posx, row];
|
2011-09-17 10:22:07 -03:00
|
|
|
|
}
|
|
|
|
|
|
2012-05-13 07:56:42 -03:00
|
|
|
|
string filename2 = "srtm_" + Math.Round((lng + 2.5 + 180) / 5, 0).ToString("00") + "_" + Math.Round((60 - lat + 2.5) / 5, 0).ToString("00") + ".asc";
|
|
|
|
|
|
|
|
|
|
if (File.Exists(datadirectory + Path.DirectorySeparatorChar + filename2))
|
|
|
|
|
{
|
|
|
|
|
StreamReader sr = new StreamReader(readFile(datadirectory + Path.DirectorySeparatorChar + filename2));
|
2011-09-17 10:22:07 -03:00
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
int nox = 0;
|
|
|
|
|
int noy = 0;
|
|
|
|
|
float left = 0;
|
|
|
|
|
float top = 0;
|
|
|
|
|
int nodata = -9999;
|
|
|
|
|
float cellsize = 0;
|
2011-09-17 10:22:07 -03:00
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
int rowcounter = 0;
|
2011-09-17 10:22:07 -03:00
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
float wantrow = 0;
|
|
|
|
|
float wantcol = 0;
|
2011-09-17 10:22:07 -03:00
|
|
|
|
|
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
while (!sr.EndOfStream)
|
|
|
|
|
{
|
|
|
|
|
string line = sr.ReadLine();
|
2011-09-17 10:22:07 -03:00
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
if (line.StartsWith("ncols"))
|
|
|
|
|
{
|
|
|
|
|
nox = int.Parse(line.Substring(line.IndexOf(' ')));
|
2011-09-14 10:31:00 -03:00
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
//hgtdata = new int[nox * noy];
|
|
|
|
|
}
|
|
|
|
|
else if (line.StartsWith("nrows"))
|
|
|
|
|
{
|
|
|
|
|
noy = int.Parse(line.Substring(line.IndexOf(' ')));
|
2011-09-14 10:31:00 -03:00
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
//hgtdata = new int[nox * noy];
|
|
|
|
|
}
|
|
|
|
|
else if (line.StartsWith("xllcorner"))
|
|
|
|
|
{
|
|
|
|
|
left = float.Parse(line.Substring(line.IndexOf(' ')));
|
|
|
|
|
}
|
|
|
|
|
else if (line.StartsWith("yllcorner"))
|
|
|
|
|
{
|
|
|
|
|
top = float.Parse(line.Substring(line.IndexOf(' ')));
|
|
|
|
|
}
|
|
|
|
|
else if (line.StartsWith("cellsize"))
|
|
|
|
|
{
|
|
|
|
|
cellsize = float.Parse(line.Substring(line.IndexOf(' ')));
|
|
|
|
|
}
|
|
|
|
|
else if (line.StartsWith("NODATA_value"))
|
|
|
|
|
{
|
|
|
|
|
nodata = int.Parse(line.Substring(line.IndexOf(' ')));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
string[] data = line.Split(new char[] { ' ' });
|
2011-09-14 10:31:00 -03:00
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
if (data.Length == (nox + 1))
|
|
|
|
|
{
|
2011-09-14 10:31:00 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
wantcol = (float)((lng - Math.Round(left, 0)));
|
2011-09-14 10:31:00 -03:00
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
wantrow = (float)((lat - Math.Round(top, 0)));
|
|
|
|
|
|
|
|
|
|
wantrow = (int)(wantrow / cellsize);
|
|
|
|
|
wantcol = (int)(wantcol / cellsize);
|
|
|
|
|
|
|
|
|
|
wantrow = noy - wantrow;
|
|
|
|
|
|
|
|
|
|
if (rowcounter == wantrow)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("{0} {1} {2} {3} ans {4} x {5}", lng, lat, left, top, data[(int)wantcol], (nox + wantcol * cellsize));
|
|
|
|
|
|
|
|
|
|
return int.Parse(data[(int)wantcol]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rowcounter++;
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-09-14 10:31:00 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-09-17 10:22:07 -03:00
|
|
|
|
}
|
2011-11-29 09:49:11 -04:00
|
|
|
|
|
2012-05-13 07:56:42 -03:00
|
|
|
|
//sr.Close();
|
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
return alt;
|
|
|
|
|
}
|
|
|
|
|
else // get something
|
|
|
|
|
{
|
|
|
|
|
if (zoom >= 15)
|
2011-09-17 10:22:07 -03:00
|
|
|
|
{
|
2012-05-13 07:56:42 -03:00
|
|
|
|
if (!Directory.Exists(datadirectory))
|
|
|
|
|
Directory.CreateDirectory(datadirectory);
|
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
if (requestThread == null)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("Getting " + filename);
|
|
|
|
|
queue.Add(filename);
|
|
|
|
|
|
|
|
|
|
requestThread = new Thread(requestRunner);
|
|
|
|
|
requestThread.IsBackground = true;
|
2012-03-03 20:42:42 -04:00
|
|
|
|
requestThread.Name = "SRTM request runner";
|
2011-11-29 09:49:11 -04:00
|
|
|
|
requestThread.Start();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
lock (objlock)
|
|
|
|
|
{
|
|
|
|
|
if (!queue.Contains(filename))
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("Getting " + filename);
|
|
|
|
|
queue.Add(filename);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-09-17 10:22:07 -03:00
|
|
|
|
}
|
2011-11-29 09:49:11 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch { alt = 0; }
|
|
|
|
|
|
|
|
|
|
return alt;
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-13 07:56:42 -03:00
|
|
|
|
static MemoryStream readFile(string filename)
|
|
|
|
|
{
|
|
|
|
|
if (filecache.ContainsKey(filename))
|
|
|
|
|
{
|
|
|
|
|
return (MemoryStream)filecache[filename];
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read);
|
|
|
|
|
|
|
|
|
|
byte[] file = new byte[fs.Length];
|
|
|
|
|
fs.Read(file, 0, (int)fs.Length);
|
|
|
|
|
|
|
|
|
|
filecache[filename] = new MemoryStream(file);
|
|
|
|
|
|
|
|
|
|
fs.Close();
|
|
|
|
|
|
|
|
|
|
return (MemoryStream)filecache[filename];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
static void requestRunner()
|
|
|
|
|
{
|
|
|
|
|
while (true)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
string item = "";
|
|
|
|
|
lock (objlock)
|
2011-09-17 10:22:07 -03:00
|
|
|
|
{
|
2011-11-29 09:49:11 -04:00
|
|
|
|
if (queue.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
item = queue[0];
|
|
|
|
|
}
|
2011-09-17 10:22:07 -03:00
|
|
|
|
}
|
2011-11-29 09:49:11 -04:00
|
|
|
|
|
|
|
|
|
if (item != "")
|
2011-09-17 10:22:07 -03:00
|
|
|
|
{
|
2011-11-29 09:49:11 -04:00
|
|
|
|
get3secfile(item);
|
|
|
|
|
lock (objlock)
|
|
|
|
|
{
|
|
|
|
|
queue.Remove(item);
|
|
|
|
|
}
|
2011-09-17 10:22:07 -03:00
|
|
|
|
}
|
2011-11-29 09:49:11 -04:00
|
|
|
|
}
|
|
|
|
|
catch { }
|
2012-07-22 04:51:05 -03:00
|
|
|
|
Thread.Sleep(1000);
|
2011-11-29 09:49:11 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void get3secfile(object name)
|
|
|
|
|
{
|
|
|
|
|
string baseurl = "http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/";
|
|
|
|
|
|
|
|
|
|
// check file doesnt already exist
|
|
|
|
|
if (File.Exists(datadirectory + Path.DirectorySeparatorChar + (string)name))
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<string> list = getListing(baseurl);
|
|
|
|
|
|
|
|
|
|
foreach (string item in list)
|
|
|
|
|
{
|
2012-05-13 07:56:42 -03:00
|
|
|
|
List<string> hgtfiles = new List<string>();
|
|
|
|
|
|
|
|
|
|
hgtfiles = getListing(item);
|
2011-11-29 09:49:11 -04:00
|
|
|
|
|
|
|
|
|
foreach (string hgt in hgtfiles)
|
|
|
|
|
{
|
|
|
|
|
if (hgt.Contains((string)name))
|
2011-09-17 10:22:07 -03:00
|
|
|
|
{
|
2011-11-29 09:49:11 -04:00
|
|
|
|
// get file
|
|
|
|
|
|
|
|
|
|
gethgt(hgt, (string)name);
|
|
|
|
|
return;
|
2011-09-17 10:22:07 -03:00
|
|
|
|
}
|
2011-11-29 09:49:11 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-09-17 10:22:07 -03:00
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
static void gethgt(string url, string filename)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
2011-09-17 10:22:07 -03:00
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
WebRequest req = HttpWebRequest.Create(url);
|
2011-09-17 10:22:07 -03:00
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
WebResponse res = req.GetResponse();
|
2011-09-17 10:22:07 -03:00
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
Stream resstream = res.GetResponseStream();
|
2011-09-17 10:22:07 -03:00
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
BinaryWriter bw = new BinaryWriter(File.Create(datadirectory + Path.DirectorySeparatorChar + filename + ".zip"));
|
2011-09-17 10:22:07 -03:00
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
byte[] buf1 = new byte[1024];
|
2011-09-17 10:22:07 -03:00
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
while (resstream.CanRead)
|
|
|
|
|
{
|
2011-09-17 10:22:07 -03:00
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
int len = resstream.Read(buf1, 0, 1024);
|
|
|
|
|
if (len == 0)
|
|
|
|
|
break;
|
|
|
|
|
bw.Write(buf1, 0, len);
|
2011-09-17 10:22:07 -03:00
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
}
|
2011-09-17 10:22:07 -03:00
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
bw.Close();
|
|
|
|
|
|
|
|
|
|
FastZip fzip = new FastZip();
|
|
|
|
|
|
|
|
|
|
fzip.ExtractZip(datadirectory + Path.DirectorySeparatorChar + filename + ".zip", datadirectory, "");
|
|
|
|
|
}
|
|
|
|
|
catch { }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static List<string> getListing(string url)
|
|
|
|
|
{
|
2012-05-13 07:56:42 -03:00
|
|
|
|
string name = new Uri(url).AbsolutePath;
|
|
|
|
|
|
|
|
|
|
name = Path.GetFileName(name.TrimEnd('/'));
|
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
List<string> list = new List<string>();
|
2011-09-17 10:22:07 -03:00
|
|
|
|
|
2012-05-13 07:56:42 -03:00
|
|
|
|
if (File.Exists(datadirectory + Path.DirectorySeparatorChar + name))
|
|
|
|
|
{
|
|
|
|
|
StreamReader sr = new StreamReader(datadirectory + Path.DirectorySeparatorChar + name);
|
|
|
|
|
|
|
|
|
|
while (!sr.EndOfStream)
|
|
|
|
|
{
|
|
|
|
|
list.Add(sr.ReadLine());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sr.Close();
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
try
|
|
|
|
|
{
|
2012-05-13 07:56:42 -03:00
|
|
|
|
StreamWriter sw = new StreamWriter(datadirectory + Path.DirectorySeparatorChar + name);
|
2011-09-17 10:22:07 -03:00
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
WebRequest req = HttpWebRequest.Create(url);
|
2011-09-17 10:22:07 -03:00
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
WebResponse res = req.GetResponse();
|
|
|
|
|
|
|
|
|
|
StreamReader resstream = new StreamReader(res.GetResponseStream());
|
|
|
|
|
|
|
|
|
|
string data = resstream.ReadToEnd();
|
2011-09-17 10:22:07 -03:00
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
Regex regex = new Regex("href=\"([^\"]+)\"", RegexOptions.IgnoreCase);
|
|
|
|
|
if (regex.IsMatch(data))
|
|
|
|
|
{
|
|
|
|
|
MatchCollection matchs = regex.Matches(data);
|
|
|
|
|
for (int i = 0; i < matchs.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
if (matchs[i].Groups[1].Value.ToString().Contains(".."))
|
|
|
|
|
continue;
|
|
|
|
|
if (matchs[i].Groups[1].Value.ToString().Contains("http"))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
list.Add(url.TrimEnd(new char[] { '/', '\\' }) + "/" + matchs[i].Groups[1].Value.ToString());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-05-13 07:56:42 -03:00
|
|
|
|
|
|
|
|
|
list.ForEach(x =>
|
|
|
|
|
{
|
|
|
|
|
sw.WriteLine((string)x);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sw.Close();
|
2011-09-17 10:22:07 -03:00
|
|
|
|
}
|
2011-11-29 09:49:11 -04:00
|
|
|
|
catch { }
|
2011-09-14 10:31:00 -03:00
|
|
|
|
|
2011-11-29 09:49:11 -04:00
|
|
|
|
return list;
|
2011-09-14 10:31:00 -03:00
|
|
|
|
}
|
|
|
|
|
}
|
2011-11-29 09:49:11 -04:00
|
|
|
|
}
|