本文整理汇总了C#中BaseLib.GlobusHttpHelper.SetProfilePic方法的典型用法代码示例。如果您正苦于以下问题:C# GlobusHttpHelper.SetProfilePic方法的具体用法?C# GlobusHttpHelper.SetProfilePic怎么用?C# GlobusHttpHelper.SetProfilePic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseLib.GlobusHttpHelper
的用法示例。
在下文中一共展示了GlobusHttpHelper.SetProfilePic方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UploadPic
private void UploadPic(ref GlobusHttpHelper httpHelper, string loggedinPageSource, string referer)
{
try
{
string localImagePath = "";
string imagePath = string.Empty;
try
{
Interlocked.Increment(ref counter_PicSelected);
if (counter_PicSelected >= lstpicfile.Count)
{
counter_PicSelected = 0;
}
//localImagePath = lstpicfile[new Random().Next(0, lstpicfile.Count)];
localImagePath = lstpicfile[counter_PicSelected];
}
catch { }
Log("[ " + DateTime.Now + " ] => [ Images : " + localImagePath + " Select For UserName : " + userName + " ]");
string status = string.Empty;
string profileId = GetProfileId(ref httpHelper, loggedinPageSource);
string postUrl = "http://www.linkedin.com/mupld/upload?goback=%2Enpv_" + profileId + "_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1%2Enpe_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1";
string[] upload_infoArr = Regex.Split(loggedinPageSource, " name=\"upload_info"); // name="upload_info"
string upload_info = string.Empty;
if (upload_infoArr.Count() > 1)
{
try
{
upload_info = upload_infoArr[1].Substring(upload_infoArr[1].IndexOf("value="), upload_infoArr[1].IndexOf("id=") - upload_infoArr[1].IndexOf("value=")).Replace("value=", string.Empty).Replace("\"", string.Empty).Replace("\\", string.Empty).Trim();
}
catch { }
}
else
{
try
{
string[] upload_infoArr1 = Regex.Split(loggedinPageSource, "id\":\"upload_info");
upload_info = upload_infoArr1[1].Substring(upload_infoArr1[1].IndexOf("value\":"), upload_infoArr1[1].IndexOf("type") - upload_infoArr1[1].IndexOf("value\":")).Replace("value\":", string.Empty).Replace("\"", string.Empty).Replace("\\", string.Empty).Replace(",", string.Empty).Trim();
}
catch { }
}
try
{
bool PostStatus = false;
try
{
PostStatus = httpHelper.SetProfilePic(ref httpHelper, profileId, userName, password, localImagePath, proxyAddress, proxyPort, proxyUsername, proxyPassword, ref status, upload_info);
}
catch { }
if (PostStatus)
{
GlobusFileHelper.AppendStringToTextfileNewLine("Profile Picture Changed Successfully To UserName : " + userName + " In Image Path : " + localImagePath, Globals.path_ProfPicSuccess);
Log("[ " + DateTime.Now + " ] => [ Profile Picture Changed Successfully To UserName : " + userName + " In Image Path : " + localImagePath + " ]");
}
else
{
GlobusFileHelper.AppendStringToTextfileNewLine("Profile Picture Not Changed Successfully To UserName : " + userName + " In Image Path : " + localImagePath, Globals.path_ProfPicFail);
Log("[ " + DateTime.Now + " ] => [ Profile Picture Not Changed Successfully To UserName : " + userName + " In Image Path : " + localImagePath + " ]");
}
}
catch { }
}
catch
{
}
}