我想从teamcity中提取文物。

我一直在尝试使用c#和HtmlAgilityPack转到网站并找到最新版本及其工件。我目前陷入登录状态,我想我只需要发送Session Cookies。

我是朝着正确的方向前进的,还有其他人试过吗?

我意识到使用构建脚本推出文件很容易,但我想尽量减少对Ant,NAnt文件的更改,因为我正在考虑将其扩展到100个应用程序。

修改:这个问题看起来很有希望从登录页面获取HTML

编辑:现在可以使用,我只需编写一些代码来解析它

WebClient ww = new WebClient();
ww.Credentials = CredentialCache.DefaultCredentials;
ww.DownloadString("http://yourteamcity.com/login.html");
ww.Headers.Add("Cookie",ww.ResponseHeaders["Set-Cookie"]);

NameValueCollection post = new NameValueCollection();
post.Add("username", "name");
post.Add("remember","true");
post.Add("submitLogin", "Login");
post.Add("publicKey","long thing to intercept with fiddler");
post.Add("encryptedPassword","not giving you this");
post.Add("_", "");
byte[] values = ww.UploadValues("http://yourteamcity.com/loginSubmit.html", "POST",post);
string s = ww.DownloadString("http://yourteamcity.com/overview.html");
有帮助吗?
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top