Diablicolic Posted August 10, 2003 Posted August 10, 2003 Ok I've got this mp3 (Gnosis.mp3), and it's an embedded resource within my project (Pindleskin Bot). I want to copy the mp3 to the cookies on the target person's computer (whoever uses the program). The error is on the bottom of the page, and here's the code: Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'This just changes my cursor on the form MyBase.Cursor = New Cursor(Me.GetType().Assembly.GetManifestResourceStream("Pindleskin_Bot.Cross.cur")) 'This makes me feel happy lblTalk.Text = "Welcome Eradication," 'This is where I check and see if Gnosis.mp3 is there 'If it is then I just delete it, because it might 'be a bad copy Dim Exists As Boolean Exists = System.IO.File.Exists(System.Environment.GetFolderPath(Environment.SpecialFolder.Cookies) & "/Gnosis.mp3") If Exists = True Then System.IO.File.Delete(System.Environment.GetFolderPath(Environment.SpecialFolder.Cookies) & "/Gnosis.mp3") End If 'This is how I hook up to my resources to get Gnosis.mp3 Dim thisExe As System.Reflection.Assembly thisExe = System.Reflection.Assembly.GetExecutingAssembly() Dim file As System.IO.Stream = _ thisExe.GetManifestResourceStream("Pindleskin_Bot.Gnosis.mp3") 'And this is where I want to write the mp3 to the 'cookies path!! But it don't work! Dim Write_mp3 As New System.IO.StreamWriter(file) Write_mp3.Write(System.Environment.GetFolderPath(Environment.SpecialFolder.Cookies) & "/Gnosis.mp3") Write_mp3.Flush() Write_mp3.Close() file.Flush() file.Close() 'This is what plays Gnosis.mp3, but there ain't no 'mp3 to play Dim Background As Audio Background.FromFile(System.Environment.GetFolderPath(Environment.SpecialFolder.Cookies) & "/Gnosis.mp3") End Sub Quote "Reality is fake, Dreams are for real"
Diablicolic Posted August 10, 2003 Author Posted August 10, 2003 Wait I got the streamer to work, I got it backwards, it's actually suppose to be this: Dim Write_mp3 As New System.IO.StreamWriter(System.Environment.GetFolderPath(Environment.SpecialFolder.Cookies) & "/Gnosis.mp3") Write_mp3.Write(file) But when I looked in my cookies, I could find Gnosis...but it's 33 bytes? ---Edit---- I took out the flushes and closes of the streamwriters, and now the Gnosis.mp3 inside of the cookies....is 0 bytes? The true Gnosis.mp3 that is inside of the project folder is suppose to be 5.10 MB. This is all weird =| Quote "Reality is fake, Dreams are for real"
Administrators PlausiblyDamp Posted January 18, 2004 Administrators Posted January 18, 2004 Why on earth do you want to store an MP3 in the cookies folder? Would using the Temp directory, the application's direcory or storing it as part of the user's application data not be far more appropriate? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.