Posts Tagged ‘Asp Net’

How To Use .NET Cookies

If you want to access, read, write or otherwise store and send cookies in .NET you will need to access the request objects cookiecontainer. Once you have that in your sights, you can grab the cookiecollection and pick up the cookie that you need.

Here is an example;

Dim req As HttpWebRequest = CType(WebRequest.Create(http://urlgoeshere.com, HttpWebRequest) req.Method = “POST” req.CookieContainer = New CookieContainer ‘get the response Dim res As HttpWebResponse = CType(req.GetResponse(), HttpWebResponse) ‘now get the cookies res.Cookies = req.CookieContainer.GetCookies(req.RequestUri) Dim ck As System.Net.Cookie = res.Cookies(“CookieName”)

Once you have the cookie, it’s simple to add it to your request

‘add the cookie to the request req.CookieContainer = New CookieContainer req.CookieContainer.Add(ck)

So if you ever need to grab a cookie and then use that cookie in another request for authentication purposes, thats what you do…

The Joys Of XML

I’m currently working on a project that requires posting and reading response online using XML. I’m not talking about web services here, it’s a plain old POST of an XML file, response is returned as copious amounts of XML, read that and build a web form based on the contents (yawn), have website user make selections and POST that back as plain old XML, get another response back as, yep you guessed correctly, XML and read that, make a decision based on the contents and voila, we’re done.

 I’m a little bit surprised that the company that runs this service, the bowels of which I am groping around in, has not developed a SOAP API or Web Services API that can be programmed against without the raw manipulation of XML (i.e. text) data. I’ve used the Amazon, PayPal and EBay API’s and while there is a hefty learning curve it is far more intuitive, in my humble opinion, to code against an API than against raw XML.

Whenever I start having to parse text files, I don’t care if we have XSD files and a schema, yada yada ya, I feel like I’m using old technology that is cumbersome, although it does the job, right. I know that the legacy of XML and the use of text goes back a long way, when it was far more difficult, time consuming etc to open up a port and configure a firewall, so passing text through was an easy solution.

I can only guess that this company has so much legacy code and systems that the move to a SOAP API and web services infrustructure is still in the pipeline. Just as there are still tons of companies that still use EDI right?

PayPal Payments Pro 4.2

I’ve just upgraded a clients payment system to use the Paypal API. One new feature that I like is the API signature option for verification.

Previously you had to download and install a server side certificate to verify payments through the API. This was quite easy to do but you have quite a number of things to do to get the certificate installed etc. There are certainly some management issues when you are dealing with a number of sites.

With the API signature, you call the web service with an signature string that PayPal generates for you and you can do all your verification on the client side. It’s easy to setup multiple sites using this method.

If you’re thinking of upgrading, download the 4.2 api sdk files and use the paypal_base.dll and log4net.dll files. Then simply modify your Profile code to call createAPISignature.

Then set your username, password, environment and signature and away you go!

The only thing I’ve found time consuming with configuring and using the PayPal api is setting up the sanbox accounts and some of the documentation could be better.

On the whole its pretty darn good though and the Payments Pro solution only costs $20 per month plus transaction fees.

Good stuff!

IT Works!

I’ve written somewhere on my website how I try to provide solutions that give a good return on my clients investment.

Unfortunately with Information Technology you don’t generally get any kind of feedback on the good stuff. You only hear when things are going wrong. That has a tendency to happen because the results are often difficult to quantify. Also, in a lot of cases, the client has no mechanisms in place for measuring any return or tracking results. So a lot of the time, we’re fighting an uphill battle.

However, I’ve recently been informed that software development projects that I’ve designed and built with one of my customers is producing MASSIVE growth within the company. This has been proved by the fact that they have rolled the system out for 5 new clients in the last few months. They have also committed to a large spend on new hardware and software upgrades and they are moving to new, bigger office complex where they will be leasing an entire floor. So their investment in IT solutions is paying off handsomely for them.

I’m so happy that they are seeing these benefits. Not just because it’s good for my reputation, but because it will hopefully inspire them to try more things with technology that will give them an even greater advantage over their competitors, provide more jobs at the company and allow them to help more people who user their business services too.

They are a student loan consolidation company based in Pinellas Park. We’ve rolled out some fairly leading edge technology using .NET, ASP.NET, web services, SQL server, SQL server reporting services and encryption.

The new client roll outs take less than 4 hours and they can effectively offer their services in this way, providing great leverage in their business with additional revenue streams built on what was initially a one off internal development project. However, as always, I tried to provide a reusable solution that could be pretty easily adapted and developed and that paid off too. That’s really a great benefit of developing for the Windows platform and using the .NET framework and related technologies.

So everyone’s happy! Neat!

What Is Web 2.0?

I’ve seen a lot of posts recently about web 2.0 and it seems there are a lot of different ideas about what it is exactly.

I guess this is not surprising as it is marketers and marketing departments in companies that are trying to define it. If that’s the case I think those camps will have as much success defining web 2.0 as they did defining the .NET Framework. They are related any way right?

I’ve seen Web 2.0 described as social networking. Community sites that allow people to create profiles and share information and resources. Well, though we do now have some huge social networking sites like mySpace and it seems like everyone and their brother needs to get online and slap up a profile and some pics, that’s hardly a new concept is it? Readily accessible to the masses now yes, but we’ve had bulletin boards for donkeys years and forums too.

I’ve seen it described the merging of web with video to an online experience more like TV (Oh God Noooo, we can’t allow that to happen). But if video and streaming media is becoming more prevalent now, isn’t it bandwidth that has allowed that to happen? With 2/3 + US users having broadband internet access according to a recent report by Nielsen-Netratings.com. � I’ve seen it described as this fabulous new technology called AJAX but little or no discussion of how this works etc (mainly marketing talk remember).

Here’s my take on web 2.0 just for the record. Web 2.0 is the merging of the www with the desktop of your computer. Eventually, you won’t really know if you are online or not. Your user experience will be the same when you are using installed programs or using a website (to the untrained marketers eye anyway). So AJAX and related technologies will play a large part in making Web 2.0 happen.

Yes web 2.0 will include streaming video and audio and chat and email and signups and downloads etc. The key thing is it will all be pretty transparent to the end user. You won’t be aware of being online (we aren’t so much anymore with broadband now right)

Maybe it will be Web 3.0 before its truly transparent…

Ecommerce System Development

It’s been difficult to do any development work for TRS Technology because I’ve been so busy with customer account work. However, I’ve worked like a dog evening and weekends in order to be able to make this system available for myself and, of course, my beloved customers.

So, what’s it all about then?

My new ecommerce platform encompasses the following components / systems.

  1. Sales and marketing
  2. Payment processing
  3. Product delivery and fulfillment

Systems used or integrated are;

  1. Email marketing using auto responder
  2. List building with special reports or free downloads
  3. Affiliate marketing
  4. Customizable offers using sales pages
  5. Ability to track visitors and conversion on those sales pages
  6. Offer cart for payment processing of the offer items
  7. Ability to up sell and or cross sell
  8. Invoicing after payment
  9. Collection and storage of all customer data in sql server
  10. Product delivery immediately if digital downloadable product
  11. Ability to deliver a mix of digital and retail products that require shipping
  12. Emailing invoice to customer at payment
  13. Adding customer to a specific customer list for each product to allow follow-up after purchase and follow on sales / repeat sales
  14. Ability to request download links for a product if lost
  15. The customer can remove themselves from any or all product list if they want to

That’s an approximate outline of the system. I’ll post an update soon about the technology used in the cart (AJAX), which is very cool.

I’ll also post a rationale as to why I developed this rather than using other systems that are available. There are a lot of reasons…

Windows .NET, Web Services & Web Development

This project is going to be really interesting! It encompasses all of the following technologies and will no doubt be quite a challenge!

1. Windows .NET development (Windows Forms) 2. Encryption (3DES) 3. FTP 4. Website ASP.NET development 5. SQL Server Reporting Services 6. Secure Sockets Layer 7. XML Web Services

I don’t think i’ve missed anything. This is going to be a doozy!

AJAX – not for cleaning the toilet with!

Ajax, shorthand for Asynchronous JavaScript and XML basically allows you to post back to your web server and return without a full refresh of the page. It’s very nice for the website visitor as just the requested area of a page can be refreshed, so the interaction with the web server seems almost non existent.

I was looking for a new tabstrip control for a website project that I’m working on for Cannons Marina .

The control suite I bought is from a company called ASPXLAB. All of the controls are nice and easy to use and code and the AJAX component is really good too.

ASP.NET Programming

It’s a tough job but somebody has to do it. Seriously though, coding can be a very enjoyable creative process. It can also be a complete pain and sometimes deliriously tedious! As a professional ASP.NET Programmer I’ve written a lot of code, some of which I am very proud (or at least was at the time I wrote it!).

If you’ve never seen .NET programming, I’m posting a little appetizer here for you now. My sincere apologies if you find this sleep inducing :) and the formatting is not very neat in this html editor but you will at least see what it looks like and realize that all programmers must be somewhat insane…

Private Function InsertBreaksForWrapping(ByVal sb As System.Text.StringBuilder, _ ByRef curPos As Integer, _ ByRef newPos As Integer, _ ByRef curLength As Integer, _ ByVal iLength As Integer, _ Optional ByVal EOF As Boolean = False) As System.Text.StringBuilder Try If Not EOF Then ‘the long text is within the string so… Do While curLength > iLength sb.Insert(curPos + iLength, vbCrLf) curPos += iLength ‘set the new position in the string newPos = sb.ToString.IndexOf(” “, curPos + 1)

If newPos = -1 Then Exit Do ‘calculate the length of this piece curLength = newPos – (curPos + 1) Loop Else ‘this is an eof position so… Do While (sb.ToString.Length – curPos) > iLength sb.Insert(curPos + iLength, vbCrLf) curPos += iLength Loop End If ‘return stringbuilder Return sb Catch ex As Exception End Try End Function

Newsletter Manager – RSS & Atom Feeds

I’ve been working on updating my own website using RSS & Atom feeds. This is further work that started with a new service that I introduced at the beginning of this year called Newsletter Manager.

So, Newsletter Manager uses RSS feeds to provide additional, hopefully on-topic, information links in the newsletter that readers can then follow and peruse at their leisure.

I’m now implementing a reader that will incorporate feeds into my own sites web pages.

There’s a reason that I’m doing this… do you know what it is?