For the solid diagonal line just go to the shape tool and select the line tool with the shape layers button selected. Set your pixel width and fill style. With your shift key held down draw the line in a diagonal direction and it will "snap" to 45 degrees. If you want a vertical or horizontal then draw in that direction with the shift key held down and it will "snap" straight. If you wanted to make this diagonal a selection then use the "paths" button and go from there.
Dotted.... here is a tutorial I found after doing a quick search of the internet. I actually have been wanting to find this so now I know too!
Tutorial: Creating Dotted Lines Using Photoshop | Growing Happiness