|
if my vb.net form is trying to copy a file to a destination where the file already exists, how would i get it to rename the new file to something different?
eg: if "C:\test.txt" exists then it will rename it to "C:\test01.txt"
and if those two exist then it will rename it to "C:\test02.txt"
so you could get
"C:\test01.txt"
"C:\test02.txt"
"C:\test03.txt"
"C:\test04.txt"
..........
etc etc
|
|
|
|
|
hi
search the destination for the file.
i.e. if you are copying the file "C:\test.txt" user the following :
System.IO.File.Exists("c:\test.txt") , this will return true if the files
exist
Tamimi - Code
|
|
|
|
|
already know that code, sorry but its not what im looking for
im not looking for it to check for it and if its there then it will not copy
im looking for code that if the file is there, it will rename it and send in the same file but rename it
example: when you copy a file in windows and paste it a couple of times
it will make copies like this
Copy of Test
Copy (2) of Test
Copy (3) of Test
etc etc
im trying to make my program do that
|
|
|
|
|
You will have to set up a loop that checks for existence of the file and rename it if necessary, like:
<br />
Dim strExtnOnly as string = ".txt"<br />
Dim strFileNameOnly as string = "test"<br />
Dim blnDone as Boolean = false<br />
Dim strDest as string = "Your destination folder"<br />
dim intCounter as integer= 1<br />
<br />
do while blnDone = false<br />
strFullPath = strDest & "/" strFileNameOnly & strExtnOnly <br />
if File.Exists(strFullPath) then<br />
intCounter+= intCounter<br />
strFileNameOnly = strFileNameOnly & CStr(intCounter.ToString.padleft("0",2)) ' something like that<br />
else<br />
blnDone=True<br />
end if<br />
loop<br />
HTH
Shreekar
http://shreekarishere.blogspot.com
|
|
|
|
|
sir,
I want a function that start the search from the last character in the string for finding the character.
example
this is a string
I want to search for last blank space in the string which occurs before string word.
Thanks and Regards
Amaneet Brar
|
|
|
|
|
hi
try to use the (LastIndexOf) method.
i.e. dim x as string ="abcabc"
dim y as integer = x.LastIndexOf("c")
' y = 5
' the (LastIndexOf) method has many overloads.
Tamimi - Code
|
|
|
|
|
Does anyone know how to Make a Remote Desktop Screen Capture and keystroke recorder for VB 6.0? i'm a beginner on Visual Basic 6.0 please e-mail me at charmed_2@verizon.net
jeff
|
|
|
|
|
I would like to increase field length of a bound cell more than 50 when using true DBGrid (Component One). I used datawidth propertie of it. But it could not increase the field size.
|
|
|
|
|
It's probably because that's the maximum length specified for the field in the database.
---
b { font-weight: normal; }
|
|
|
|
|
Does anyone know how to or know where to find an article explaining converting MSIL code to VB or VC# (Or just about any other language, actually) code. The MSIL I want to convert is the Byte Array returned from he MethodBody.GetILAsByteArray Function. MethodBody is a type in the System.Reflection namespace.
|
|
|
|
|
|
THANKS!
|
|
|
|
|
Hello. I want to learn that converting an excel chart or table to pdf with iTextSharp.dll is possible or not?
If it is possible which classes I must use?
Is there any example or link that you can recommend?
If anybody help me I will be glad.
Thank you.
Murat
|
|
|
|
|
hellow to all ..
i have 2 projects that i would like to put them in one Solution ,
i did so , and i can run the project , but when i wanna access to a FORUM from first project and call it to show , i can't , how can i make this happen ?
thxx
|
|
|
|
|
you should reference one project to the other (add reference).
lets say preject1 and project2 , then go to the references on project1 ,
right click and click (add reference), on the add reference dialog go to the third tab (projects) then select project2, then press ok.
when you want access somethingin project2 inside project1 , do like this
project2.claassUser (for example)
Tamimi - Code
|
|
|
|
|
aha , great thank u i had just done this ,
but when i click the project i recive this message a refernce to 'Routes' could not be added. an assembly must have a 'dll' extension in order to be refernce .
do u have anyidea what i should do ?
thank u
|
|
|
|
|
ok
on the solution explorer select project2 then from the main menu select
Project -> Properties on the properties dialog (be sure that you are doing this for project2) change the (output type)combobox to (Class Library) then press ok().
redo what i wrote in the my first msg.
Tamimi - Code
|
|
|
|
|
thank u for ur help ! it worked for me
|
|
|
|
|
i have developed one small application in vc++.net. when i install this software in any other machine, is it required that the client system should have .Net Framework installed.??
Thanks and regards
Salai
|
|
|
|
|
Yes, the .NET framework is required on the client machine.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
This is the wrong forum. But when you say VC++ .NET do you mean that you built a .NET app. or an unmanaged app., e.g., MFC?
If the former than you need .NET on the other machine. If the latter then you don't.
Kevin
|
|
|
|
|
If everyone know how to add icon to ToolStripComboBox in VB.NET 2005, please help or give me some example
................
|
|
|
|
|
I don't how change title bar when java script alert in WebBrowser Control in VB.NET
................
|
|
|
|
|
I don't how to getting start with mobile applcation with VB.NET 2005?
Can u give me example?
................
|
|
|
|
|
hello hi,
pls give
what is the differance between empty and null
vipin paliwal
|
|
|
|