VS 2008 Override The Existing File
Jan 11, 2010my first post so: My smal problem. I am trying to make a very simple download a file program. this is the code i am using
[Code]...
my first post so: My smal problem. I am trying to make a very simple download a file program. this is the code i am using
[Code]...
What is the simplest way to check for an existing file. Every method shown to me in my text and the information gained from the Visual Studio help doesn't seem to work. Each one of them tells me the syntax is wrong. I just want a simple way to check for an existing text file that is in the defualt file location.MSDN told me to use FileSystem.FileExists(file) - VS would not take this and...My text Tony Gaddis (VB 2008) shows:
If File.Exists(FileName) Then
open file...
Else
[code].....
How can I change a Icon of a EXE that is already build with .Net. I know I can change it with ResHacker but is it possible to change the Icon with .Net Code.
View 20 RepliesI'm using jmcilhinney's library (found here), with a few modifications to make it compatible with VB.NET 2008. Using this forum's search feature, I see that it has been noted that SharpZipLib does support adding files to existing archives, but jmcilhinney's library does not implement this feature, and I have no idea where to start in writing my own method.
View 3 RepliesI have a workbook (Workbook1) that runs through some steps using visual basic, which ends up opening another workbook Workbook2). Once Workbook 2 is opened, I need to copy a section of data from it, into Workbook1 int a specific worksheet. I was able to do this by recording a macro, but the challange is, the name of Workbook 1, and Workbook 2, will vary by User. When I created the macro it uses the files as they are currently named. The section of code is below.
[Code]...
I have the below code simply to save a name and email, however i want to preserve the current lines in the text file.
'Pass the file path
sr = New System.IO.StreamWriter("subscribers.txt")
'Write a line of text.
[code].....
[code] where mem_stream variable contain the xml file. the problem is that it appends, if the file already exist, to the new one. is there a way to override the old file?
View 1 RepliesFor the page I'm developing I need a DropDownList with CheckBoxes on it, so that the users can choose more than one option without having to use the Ctrl key (and it's more intuitive). Because my options are being retrieved from the Database, the list of option can be really big, so using a CheckBoxList would use a lot of space. with this? I'm almost desperate! I have been search for a couples day, but having problems in everything I tried. What I'm trying to do now is override the DropDownList control (as suggested in this forum: [URL]), but I'm having problems right in the first line:
[Code]....
I am using Linq to Sql that generated a data contract for a table. I have a date field in that table which is a non-nullable field. I need to override the auto generated property of the date field to return a specific value, something like [code]Is it possible to override an autogenerated property in the designer.vb file using a partial class? I dont want to create a new property as it is currently being accessed in n number of places and I dont want to change it in every place.
View 1 RepliesI have to two forms. Form one has several check boxes and when a button is pressed, a second form is opened and certain functions are ran based on which check boxes are selected.The problem is that the second form doesn't show until all of the functions are done.I decided to use the Form's Activated event, which works fine. However, the event fires every time the form comes into focus.Is there anyway to override the event and make it only fire once?
View 1 RepliesBasically, what I want to do is create a new control called EncryptedPictureBox. The image path I would be loading into ImageLocation would be the path of a 512 bit encrypted image. Normally if I load this type of file, it will not display. So I want to override Load() so that I can write the encrypted image to a stream, decrypt it, and then display the stream. I'm trying to save processing time so I don't have to grab the encrypted image, save it to disk as a decrypted image, then display it, then when done, delete the decrypted image from disk.
View 11 RepliesIf I override a member (e.g AutoSize in the Button Class), then the intellisense no longer appears in the editor, forcing me to re-decorate the property. Is there an option somewhere that I need to check? ETA: Here's a code sample:
[Code]...
The intellisense explaining the AutoSize property doesn't appear.
Just say i have:
vb
Public Class Something
Inherits List(Of String)
[code].....
How would I override the method ToString() for the property CheckBox.Checked?
View 2 RepliesI'm looking for a code snippet that will add graphics (lines, circles, etc.) to an existing pdf file & write it out as a new file.
View 6 Replieshere i am reading files from one root folder and after reading that we are moving that particular file Success folder and taking a copy of that in to back up folder normal
while reading file i will check file naming convention by targeting backup folder if suppose it was exists in backup folder then i m moving the file to duplicate folder
my problem if suppose again same file came to process this file already existed in duplicate folder how do send the file in to duplicate folder, unfornately i dint have any property as file rename
If File.Exists(Swift_Backup + "" + Path.GetFileName(CBFile)) Then
' File.Move(CBFile, Swift_Duplicate + "\" + Path.GetFileName(CBFile)) 'DUPLICATE FOLDER'
[Code]....
I have a csv file that needs to be automatically updated on a daily basis. I am writing a vb.net app to accomplish this. However, Im having issues with the entire process.I need to be able to read in a csv file, manipulate the data and then update the existing file. I have dabbled with using the Excel objects but I need some assistance.
View 6 RepliesWhen i try to save a file with the same name as the existing file the message box pops up asking me if i want to replace the existing file. When i click yes the program crashes and this message come up An unhandled exception of type 'System.ArgumentException' occurred in system.drawing.dll.[code]
View 12 RepliesI need to make a program in vb that takes a 1 page existing pdf that i specify and inserts that into another existing pdf that i specify.
View 4 RepliesI know how to write and read files but I can't seem to add 1 to an existing file.
This file currently contains "10" but when I click a button I want it to +1 to that number.
I've tried a.WriteLine(+= 1) but it gives me an Expression Expected erorr which I don't get how to fix or what's wrong with it.
If anyone can help me fix or give another code that +1 to the existing numbere.
I want to write out to an xml document from a database which I can do but how do I append to it if it already exists?[code]
View 6 RepliesIm creating a login system that allows staff to clock in using a 5 digit code. Staff members can also use the "add an employee" function to add a new employee to the Random File.The problem is, everytime i try to create a new employee and hit the save button, the new record writes over the existing records, one by one, everytime the programme is stopped and started up again.
My Question is: How can i get the new record to be saved, without deleting existing records,
Here is the save buttons click method:FileOpen(fileNumber, "C:employee.dat", OpenMode.Random, OpenAccess.Write) 'open the file with Write Access
myEmployee.name = txtNewName.Text 'adds the name
myEmployee.id = txtNewID.Text 'adds the ID
FilePut(fileNumber, myEmployee, n) 'save to the file
FileClose(fileNumber)
Over writing an existing file.
View 6 RepliesThis code is working but i have a few problem in sorting of existing file.. example. Output:
[Code]...
I have xml file like following for displaying ads using asp:AdRotator in asp
<?xml version="1.0" encoding="utf-8" ?>
<Advertisements>
<Ad>
<ImageUrl>~/xxx/xxx.jpg</ImageUrl>
[code]....
now i want to add new data between ... tag in asp.net using vb how to do that..?
i have started a program that reads the names, number and picture location from an xml file and populates text boxes. I now want to be able to update the text boxes and rewrite the xml file and save it to the same location.
Imports System.Xml
Dim H1 As New XmlDocument()
Dim xlist As XmlNodeList = H1.SelectNodes("/itemname")
[code].....
I know how to set an attribute and set multiple attributes but how would I add a attribute to the existing attributes...
View 11 RepliesI've got lots of XLSX files and I need to append a new row after the last one in the file. I'm using OpenXML and so far I know how to open/create spreadsheet, but my search for adding new rows to existing files returned nothing.
View 1 RepliesPlease see the code below:
Dim objExcel As New Excel.Application
Dim objWorkbook As Excel.Workbook
Dim objSheet As Excel.Worksheet
[code].....
I want to create VB.NET code that will change the filename of selected image files that are already stored on my ISP's web server. I know how to do this by reading the image into memory and then saving it as a new file. However, I would prefer not to regenerate the image. I just want to change the filename. Is this possible?
View 2 Replies