Startup Counter, Problem With Saving File.
Apr 19, 2011
Hello,
I wanted to make the application to count how many times it has been runned..so I could make something like a restriction. You know..like run 10 times and get full version.. anyway..I did not find anything to count the startups..so I tried to make the application to create a folder on startup and save a empty file to it and count how many files are in that folder and display it in label which will say ' Application started for ' + files in the folder + 'times'. I think It could work but I get stuck when I want to save the empty file..I even made a RichTextBox for saving it but it just don't save even if I put text in the textbox..it just create the folde. I have made other Apps which creates folder on startup and then a timer which will save the file every X mins and it worked I even copied the code from that project but still it isnt working... Ill post my code below please help me.
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim SAPI
SAPI = CreateObject("sapi.spvoice")
SAPI.Speak("Welcome and Have Fun.")
System.IO.Directory.CreateDirectory("D:Sys")
Threading.Thread.Sleep(50)
RichTextBox1.SaveFile("D:Sys
fo" + TimeOfDay + ".txt")
Dim s As String = "D:Sys"
Dim d As New System.IO.DirectoryInfo(s)
Dim intFolders, intFiles As Integer
intFiles = d.GetFiles.GetUpperBound(0) + 1
Label6.Text = ("Program Started for " & intFiles.ToString & " time(s).")
End Sub
I tried to put the saving to a timer and it seems like somethings wrong with the saving :
RichTextBox1.SaveFile("D:Sys
fo" + TimeOfDay + ".txt")
..I am sute that it should look like this if I want to save a file which name will be the time it has been saved...or am I wrong?
View 3 Replies
ADVERTISEMENT
Feb 21, 2011
For my application, there is a login form in which users have the option for it to "save the login information" Kind of like MSN or other websites in which you go to a login page an the information is filled out. On my login form, I am using this code for my checkbox which is to "save login info"
Private Sub CheckBox1_CheckChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.Click
Dim s As New System.Text.StringBuilder
[Code]....
View 4 Replies
May 20, 2010
I have this code sample from a book I'm reading which looks to be incorrect:
Imports System.Diagnostics
Sub Main
Dim pc As New PerformanceCounter("PerfApp", "Clicks", False) 'excepiton here
pc.Increment()
counterLabel.Content = pc.NextValue().ToString()
End Sub
There excepion message I get is: The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly. I looked for a property to see if I can set it but couldn't find one.
View 3 Replies
Feb 12, 2012
Currently I am saving data from my applications by saving a text file via a stream reader as a string. I have come to a problem. In my current application, I have an array of the following structure:
[Code]...
View 7 Replies
Jun 20, 2010
I can hide my startup form (or make it appear hidden) on startup. I can start my app on windows startup--through registry values--if the user checks a checkbox.
But if the app starts up on windows startup, I want the form to be hidden, so the program can just keep working without bothering anyone. If it starts up because the user started it, I want the form to be showing, because the user probably wants to change some settings or something.
View 8 Replies
Mar 4, 2010
How to make an Application to startup at the system startup? and How to enable and disable?
View 6 Replies
Jun 1, 2011
I created a VB.Net Windows Forms application and my Form1 is my startup form. I want to have a class be my startup file instead of my form. In c# you have program.cs which does that for you but I cant seem to find something like that in vb.net.
View 1 Replies
Aug 22, 2011
Is there a way to delete my running appliction ?I've tried it with:
Kill(Application.ExecutablePath)without success.
If this ain't possible is there a way to delete the file at the next startup of the computer?
View 1 Replies
Jun 3, 2012
i have a word template that needs to be used in an application so to make the path simple i placed the template in the debug file and i used application.stertuppath and it worked but when i publish the application it does not work it seems that the template is not included in the application but even when i place it manually in the aplication folder it does not work
View 13 Replies
Mar 11, 2010
My application has encountered a problem and needs to close.Of course Microsoft is sorry for the inconvenience, but how am i supposed to debug my app?Which dll fails to load?
The error report contains between others, system.io.fileloadexception
How do you handle situations like these?
View 2 Replies
May 13, 2009
I just made my first 3.5 .NET app and its a simple image viewer. What I want to know is how can I set up my app so when a user clicks on a .jpg image file, it will automatically start up my app. I want it to be my default .jpg viewer.
View 4 Replies
Jan 10, 2011
I wish to have two EXE files in my project. Say one EXE has startup form ABC.vb and other is BCA.vb I am not able to change the name in Build so whatever is my startup file, my exe file's name remains the same. How to change it?
View 1 Replies
Dec 18, 2010
I have nine pictures that I need to animate -I need to use the ToString method and a counter to concatenate a file name into a string variable from the Image.FromFile method. Once the counter reaches its maximum value, and the last picture is displayed, the counter should be reset to zero or one depending on how the first image file has been name. Also a static counter variable should be incremented in the time routine. what I have so far -- I know what I have to do; however, I just do not know how to code this properly.. Right now I have this going thru a button procedure but it needs to go through a timer.
[code]....
View 2 Replies
Apr 20, 2012
I have an application I wrote that replaces Windows Explorer as a shell for Kiosk purposes. The application maintains two configuration files: one that is used and maintained for application purpose (app.config) and another that is stored in another directory so it doesn't get overwritten when the GUI attempts to update from a repository. When the application is ran in a normal environment it works perfectly. However when it is used during start-up or when switching users, the application can't seem to load the information in the other directory.
From the manager class
Private Shared rootCP As String
Friend Shared Sub loadConfig()
Dim dir As New IO.DirectoryInfo(Environment.CurrentDirectory)
[Code] .....
Another function later attempts to retrieve the data from the rootCP string but can only access it if the application was started after system start-up.
View 1 Replies
Nov 11, 2009
i deleted my previous start up form to be replaced by another one but each time i launch the application,the deleted start up form is still displayed.i dont know from where this deleted start up form is being loaded.
View 3 Replies
Jan 25, 2010
I am trying to create a setup file which would automatically install a link to the executable in the User's Desktop and Startup--> Program. However despite following all the steps in the right order I do not see any short cut in the desktop and Start -> Program.
View 4 Replies
Nov 6, 2009
I'm creating window application with VB.NET and flatfiles.the problem is how do i store the connection string in the app.config file that include the application.startup path?
<add name="cn" connectionString="provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Application.StartupPath + "data;Extended Properties=text;" />
i got some error when writing to app.config.
"Missing attribute value on attribute 'Application.StartupPath'."
View 1 Replies
Dec 12, 2009
I am creating a shell for a FORTRAN application which reads a tab delimited text file.Because I am using Excel to manipulate data, is it possible to use the Excel Automation features to "save as" a tab delimited text file?The only method available seems to be a unicode text format, which does not work. Or is there another format that mimics tab delimited so that the FORTRAN application will read such a file without difficulty?
View 1 Replies
Mar 9, 2009
I have an asp page with vb.net code that will query a database and present the user with the number of records that exist that need to be exported along with a button to export them. After you push the export button, it will prompt for a location and filename. But after that, it will not refresh the page with the new counts that now exist. Or in this case update the count to zero for the button they clicked.
[Code]
So how can I tell the page to refresh with the new counts. It almost seems like I need to tell the process to wait until after the user has finished finding the location and saving the file but I don't want to add a generic threading.thread.sleep in, I want it to only wait until they are done and then refresh the page.
View 3 Replies
Sep 18, 2011
Currently the reports are saved as a html file called report1.html, id like to make the user enter a name for the HTML file upon clicking submit.
A little stuck on how to make the filename for the HTML file save to a input entered by the user.
I currently have:
Try
'Open new HTML file to be written
WriteHtml = New StreamWriter(Application.StartupPath & "ListHardware.html")
If Not (WriteHtml Is Nothing) Then ' Is the File Open
[Code].....
View 4 Replies
Sep 11, 2011
i have a xdocument.load(file) and after changing some values want to xdocument.save(file)
this save is not possible because file is in use ?
nattelip Private Sub savechfid_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles savechfid.Click
[Code]...
View 19 Replies
Apr 25, 2009
i just found a new error problem on my app.. i have a save button that saves text1. as the file name and text2. as the content.. i recently tried to save this file name on my app: HKEY_LOCAL_MACHINESoftwareC07ft5Y as a file name, and due to the in the file name, it made my app error and close without being able to save my file.. my question is, how to bring a msgbox saying "invalid characters in file name" instead of causing it to error and shut down. (just found out that registry entry is for SafeDisc-enabled products, although, i'm not fully sure..)
[Code]...
View 11 Replies
Aug 10, 2009
I'm trying to find out if it is possible to something and really need your help.
What i want to be able to do is have a RichTextBox on my form that i can enter my description into, then when i have finished i want to be able to save it to a memory stream as a .html file.
I then want to be able to read the source of the HTML file to amend the format of the description and then display it in a webpage?
View 1 Replies
Jun 9, 2011
Here is my current file
Public
Class Form1
Dim ScreenData(3, 4) As TextBox
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
FileOpen(1, CurDir() &
[Code]...
View 2 Replies
Apr 23, 2011
I have a label that reads a random line from a text file and that string becomes the text for the label.
Now the problem; the label will only work if it is clicked because the event handler is click.What I need is this to work automatically at startup. In other words, it should change the label's text to the random string of the text file on startup of the application.
Here is my code.[code..]
View 4 Replies
Jun 2, 2011
lets say I have a form (form1) with lables a-z which are all designed with default text "0". So they all show 0 on program startup. which is fine. I also have a dialog with 2 TextBoxes; I want my program to update the default text/value on (only)form1 labels x, y and z to whatever was put into the textboxes when i press the OK button on the Dialog, so these specified labels show the 'new' value on next startup. Is it even possible or should I save the values to a file which loads the values in the specified labels on startup?
View 5 Replies
Apr 4, 2010
I've been working with Editing a jpg through Hex. I have the code to open the hex of a file, but I just need to know how to write the file so it is able to be viewed as the same jpg. Editing aside, I just need to know how to write the file. Here's the code I have so far.
[Code]...
View 4 Replies
Mar 8, 2010
I am working on a note taking application. I have got a treeview and a richtextbox. On the treeview note captions are organized in a hierarchy. When a tree node is clicked related note details are displayed in the richtextbox. I use an xml file to save and load the treeview state (including nodes, expand collapse state, image index etc). I want to include all the note details in this xml file as well. But I dont know how to save richtextformat into an xml file.
View 2 Replies
Aug 30, 2010
I have this script that I'd like to in addition save as a xls file, also save as a .txt in the same directory, or even a different one. Can I get some guidance here?
Imports System.IO
Module Module1
Private Property fs As Object
Private Property BaseName As Object
Private Property FullTargetPath As Object
[Code]...
View 2 Replies
Jun 9, 2009
in a winform how do i get one of those fancy windows "save file as" dialogues to appear so that the user can save a string as a file to a user-specified location on their hardrive?
View 4 Replies