Hello! I am working on a problem to count characters (without using strings) and I got my program to work! However, I got it to work before I put the code that counts characters into a function (countChar), which is required for this assignment. I'm not sure I understand how to open the file in main and then reference that file in a function. I am posting both versions of my code. The first works, the second does not display cout in my function, but does exit. Any explanation on how to link the function to the file I'm opening …

Member Avatar
Member Avatar
+0 forum 2

Hi, was wondering if it is possible to use openfiledialog to find a file and then use streamreader to read the text and use it in a variable? Got this so far but it comes up with this error: "Object reference not set to an instance of an object." the error appears on the "lblhighscore.Text = SR.ReadLine();" line OpenFileDialog HiScoreOpen = new OpenFileDialog(); HiScoreOpen.Filter = "TXT|*.txt"; if (HiScoreOpen.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string openFileLocation = HiScoreOpen.FileName; StreamReader SR = null; SR = new StreamReader(HiScoreOpen.FileName); lblhighscore.Text = SR.ReadLine(); SR.Close(); highscore = lblhighscore.text; Thanks

Member Avatar
Member Avatar
+0 forum 1

HI , I'm currently creating a system for medical record for our school project i was wondering , if someone could help me.. i always get this error " Couldn't find 'C:/User/...' " i coudnt retrieve the filename of the picture so that i can store it in my database , BUT when I try my back up file it works .it save image in the Database It's the same code , i did not change anything here is a part my code.. please help :( [CODE] Private Sub MDISaveToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripButton.Click If …

Member Avatar
Member Avatar
+0 forum 3

hi there, i'm creating an app in C# which allows users to select an image by double clicking the "pictureBox1", from there it selects the image, creates a new Graphics object and passes the Bitmap to it. Once the picture has been loaded the user should be able to move the picture around using the mouseDown, mouseMove, mouseUp events. I have got the image to load correctly, but it does not move.. if i alter the code, it moves, but the user is unable to select a new image(by double clicking), and it will just load a box with a …

Member Avatar
Member Avatar
+0 forum 5

Hello everyone. I'm currently developing a download manager and converter for audio and video files. Does anyone know how can I get the music file from a specific folder from my computer (I already used openfiledialog) and putting it into a listview? e.g. FILE NAME FILE TYPE Born this way.mp3 MP3 Thank you! chellemits

Member Avatar
Member Avatar
+0 forum 1

Hello guys. I'm doing a project now. I'm having a problem on getting specific file type from my computer using the .getfiles function. Here's my codes. [CODE]Private Sub dlgOpen_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles dlgOpen.FileOk Dim filepath as String = "C:\" dlgOpen.CheckFileExists = True txtOpen.Text = dlgOpen.FileName sizetext = "MB" If System.IO.Directory.Exists(filepath) Then Dim myDir As New System.IO.DirectoryInfo(filepath) For Each myFile As System.IO.FileInfo In myDir.GetFiles("*.mp3") Me.lblFname2.Text = myFile.FullName.ToString() Me.lblFtype.Text = myFile.Extension.ToString() Me.length = ((myFile.Length.ToString / 1024) / 1024) Me.length = Format(length, "0.00") Me.lblsize2.Text = length & " " & sizetext Next End If End Sub [/CODE] What …

Member Avatar
Member Avatar
+0 forum 8

anybody know how to save picture in picture box after upload and set picture witdh+heigh size. i want same picture in picturebox after i relaunch application .. i use this code to upload picture into picturebox....please anybody [code] Dim OpenFileDialog1 As New OpenFileDialog With OpenFileDialog1 .CheckFileExists = True .ShowReadOnly = False .Filter = "All Files|*.*|Bitmap Files (*)|*.bmp;*.gif;*.jpg" .FilterIndex = 2 If .ShowDialog = DialogResult.OK Then ' Load the specified file into a PictureBox control. PictureBox1.Image = Image.FromFile(.FileName) End If End With [/code]

Member Avatar
Member Avatar
+0 forum 2

The End.