When I was younger I used to plug the output of my stepdad's amp straight into his laptop's sound card, heh...
Um, that worked but it was probably quite dangerous. The safest thing is probably to direct inject (pref. with a proper DI box) your guitar into a nice mixer and plug the line out from the console into your sound card's line level input.