TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Thulasiram pakala
912
872
115.5k
Hi i having one class file asp.net web application in that they are ca
Feb 10 2021 4:20 AM
Hi i having one class file asp.net web application in that they are send data using web api Httpclient and Json what i want daily need to expoert data button click what i want by using console or windows service i want to create one setup file while click that class method need to call and execute daily in particualr time any body send that type code console application and how to call that class method
public
static
string
PreparePost(
object
input,
string
fmodulename)
{
string
res =
""
;
string
inputJson =
""
;
if
(fmodulename ==
"procurementstage"
)
{
inputJson = input.ToString();
}
else
{
inputJson = (
new
JavaScriptSerializer()).Serialize(input);
}
//string apiUrl = "http://api/" + fmodulename.ToString().Trim();
string
apiUrl =
"http://api/"
+ fmodulename.ToString().Trim();
apiUrl = ConfigurationManager.AppSettings[
"bcturl"
].ToString() + fmodulename.ToString().Trim();
HttpClient client =
new
HttpClient();
try
{
HttpContent inputContent =
new
StringContent(inputJson, Encoding.UTF8,
"application/json"
);
HttpResponseMessage response = client.PostAsync(apiUrl, inputContent).Result;
if
(response.IsSuccessStatusCode)
{
res = response.Content.ReadAsStringAsync().Result;
}
}
catch
(Exception ex)
{
throw
ex;
}
return
res;
}
like other method also i need to call in
Reply
Answers (
2
)
how set code for school fees type in monthly , quarterly, Annually in
my question is in the detail section .please see it .