Avatar of awalkinthepark
awalkinthepark

asked on 

Powerscript to C#

The attached file is a sample script that will login to a site then using
and index file , which is simple delimited text,  it  retrieves
pdf's.
Would greatly appreciate it if someone knows the C# or vb.net equivalent
code for these parts:   post the  username and password, get the  cookie, and then
request the PDF's , using a URL  that's in the index.
Looks to me that the  request for this has to include the  cookie in the
header, otherwise it just gets redirected to the login page.

Reason I don't want to just use the script is that I need to be able to load the index into a
DB and filter out only the ones we want. Sure, I could rewrite the index file, but
a  .net version would be very handy to have.

So, this part
"the C# or vb.net equivalent
code that will post the login creds, get the  cookie, and then
request the PDF's , using a URL  "


Thanks
PowershellC#

Avatar of undefined
Last Comment
awalkinthepark
Avatar of kaufmed
kaufmed
Flag of United States of America image

What attached file?
Avatar of awalkinthepark
awalkinthepark

ASKER

file attached
powerscript.txt
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of awalkinthepark
awalkinthepark

ASKER

Works.  
Just modified it some  to fit our application, the guts of it are right.
Thanks!
C#
C#

C# is an object-oriented programming language created in conjunction with Microsoft’s .NET framework. Compilation is usually done into the Microsoft Intermediate Language (MSIL), which is then JIT-compiled to native code (and cached) during execution in the Common Language Runtime (CLR).

98K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo