Showing
1 changed file
with
21 additions
and
0 deletions
| ... | @@ -500,5 +500,26 @@ namespace VulnCrawler | ... | @@ -500,5 +500,26 @@ namespace VulnCrawler |
| 500 | yield return vuln; | 500 | yield return vuln; |
| 501 | } | 501 | } |
| 502 | } | 502 | } |
| 503 | + public static IEnumerable<string> SelectRepositbyName(string _username) | ||
| 504 | + { | ||
| 505 | + String sql = string.Empty; | ||
| 506 | + MySqlCommand cmd = new MySqlCommand(); | ||
| 507 | + cmd.Connection = Conn; | ||
| 508 | + cmd.CommandText = "SELECT repository FROM vuln.auth_user WHERE username = '" + _username + "'"; | ||
| 509 | + string a = null; | ||
| 510 | + | ||
| 511 | + //sql console write 확인용 | ||
| 512 | + Console.Write(cmd.CommandText); | ||
| 513 | + | ||
| 514 | + System.Data.DataSet ds = new System.Data.DataSet(); | ||
| 515 | + MySqlDataAdapter da = new MySqlDataAdapter(cmd.CommandText, Conn); | ||
| 516 | + da.Fill(ds); | ||
| 517 | + //string을 넣음 | ||
| 518 | + foreach (System.Data.DataRow row in ds.Tables[0].Rows) | ||
| 519 | + { | ||
| 520 | + a = Convert.ToString(row["repository"]); | ||
| 521 | + yield return a; | ||
| 522 | + } | ||
| 523 | + } | ||
| 503 | } | 524 | } |
| 504 | } | 525 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment