But after startup, I insert a SD card. Then something is happening... I really dont know what...
To be more spesific, It seams to arduino freezes...
Some Serial.print() statements would tell you whether that was true, and if so, where the problem is.
But, look at your code. On startup, setup() is run, and fails in the call to SD.begin(), if there is no card.
Then, you insert a card, and (maybe) CDState is set to HIGH. If so, you try to open a file, without ever calling SD.begin() again.
You need to move the call to SD.begin() into loop(), in the CDState == HIGH block, but make sure to call it only once.