1 Replies - 1617 Views - Last Post: 12 October 2009 - 10:21 PM Rate Topic: -----

#1 systemerror  Icon User is offline

  • D.I.C Head

Reputation: -19
  • View blog
  • Posts: 205
  • Joined: 15-August 09

VB 2008 Save File

Post icon  Posted 12 October 2009 - 10:12 PM

Im trying to make something that will save something from textbox1.text I got this code

  Dim savefiledialog1 As New SaveFileDialog
		Try
			savefiledialog1.Title = "save File"
			savefiledialog1.FileName = " ClickCam.bmp "
			savefiledialog1.Filter = "Bitmap |*.bmp* "
			If savefiledialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
				Form2.PictureBox1.Image.Save(savefiledialog1.FileName, System.Drawing.Imaging.ImageFormat.Bmp)
			End If
		Catch ex As Exception
		End Try


But I want it to be saved at a location, not to open up the savefiledialog, can anyone plz help?

Is This A Good Question/Topic? 0
  • +

Replies To: VB 2008 Save File

#2 kryton46  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 6
  • View blog
  • Posts: 44
  • Joined: 29-December 08

Re: VB 2008 Save File

Posted 12 October 2009 - 10:21 PM

Can't you just hardcode a string variable, eg pathSave = "C:/Program files/etc, etc"

You can use commands like this to get the path of where the app is installed:


Dim pathSave as string = Application.StartupPath
Form2.PictureBox1.Image.Save(pathSave, System.Drawing.Imaging.ImageFormat.Bmp)


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1