-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProcessor.cs
More file actions
67 lines (57 loc) · 1.64 KB
/
Processor.cs
File metadata and controls
67 lines (57 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using System;
using System.Data.SqlClient;
using System.IO;
using System.Net;
namespace FedACH
{
public class Processor
{
string Filepath = "http://www.fededirectory.frb.org/fpddir.txt";
string QueryPath = "";
WebClient client = new WebClient();
Stream data;
public Processor() {
}
public void LoadAll()
{
data = client.OpenRead("http://www.fededirectory.frb.org/fpddir.txt");
Read();
}
public void Load(DateTime StartDate, DateTime EndDate)
{
}
public void Read()
{
try
{
StreamReader reader = new StreamReader(data);
string str = "";
str = reader.ReadLine();
while (str != null)
{
Console.WriteLine(str);
Write(str);
str = reader.ReadLine();
}
data.Close();
}
catch (WebException exp)
{
Console.WriteLine(exp.Message);
}
}
public void Write(String Line) {
try {
SqlParameter[] parameter = {
new SqlParameter("@RoutingNumber", Line.Substring(0,9)),
new SqlParameter("@OfficeCode", Line.Substring(10,1))
};
}
catch (WebException exp)
{
Console.WriteLine(exp.Message);
}
}
}
}
//SqlParameter parameter = new SqlParameter("@RoutingNumber", Line.Substring(0, 9));