|
Thanks Dave.
(Why Microsoft has to take such features off??)
- Stop thinking in terms of limitations and start thinking in terms of possibilities -
|
|
|
|
|
Can someone show me how to copy an existed Excel file (ie: c:\temp\oldFile.xls) to a new Excel file (ie: c:\temp\newFile.xls)?
Thank in-advanced
|
|
|
|
|
My.Computer.FileSystem.CopyFile("D:\filename.xls", "E:\filename.xls")
- Stop thinking in terms of limitations and start thinking in terms of possibilities -
|
|
|
|
|
It works
Many thanks
|
|
|
|
|
Search about Code Snippet and learn about it. It will help you a lot doing OS tasks.
- Stop thinking in terms of limitations and start thinking in terms of possibilities -
|
|
|
|
|
I keep getting
The remote server returned an error: (500) Syntax error, command unrecognized.
When I try to get the size of a file, The code matches what I found on the net and I also download a class with this function in it and I still get the same error. This has been driving me nuts for days now, I can't find any thing else on the matter on the net!
here is the code:
Dim u As New System.Uri("ftp://192.168.0.33/logo.ycb")
Try
Dim FTPclient2 As System.Net.FtpWebRequest = CType(System.Net.FtpWebRequest.Create(u), System.Net.FtpWebRequest)
FTPclient2.Credentials = New System.Net.NetworkCredential(mLogin, mPassword)
FTPclient2.UseBinary = False
FTPclient2.Method = System.Net.WebRequestMethods.Ftp.GetFileSize
Dim resp As System.Net.FtpWebResponse = CType(FTPclient2.GetResponse(), System.Net.FtpWebResponse)
Debug.WriteLine(FTPclient2.ContentLength)
Catch ex As Exception
Debug.WriteLine(ex.Message)
End Try
Please does someone know why this is happening?
I try both values for the Usebinary property also
|
|
|
|
|
jdionneaxsys wrote: The remote server returned an error: (500) Syntax error, command unrecognized.
This should be your clue. The FTP server you're connecting to doesn't support the commands used to tell the server to report file size.
|
|
|
|
|
Thanks for the reply, but that was my first assumption.
But an old VB6 application that I am currently porting to .NET works fine with the ‘SIZE’ command. It seems to be something with the .NET framework
Any other ideas?
thanks
|
|
|
|
|
In that case, you'll have to find a third party FTP client library that supports what you want it to do with the server that you're trying to connect to. I don't know of any myself, but a little Googling for ".net ftp client library" might come up with something.
|
|
|
|
|
I did download someone’s ftp library and that didn't work either.
There code was almost exactly the same as mine!
Bummer... I guess I’ll keep looking
thanks
|
|
|
|
|
Not sure if this would help, but I don't like your FTPclient2.UseBinary = False ,
I tend to always use binary mode for FTP, avoiding a lot of problems.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Thanks for the input, but I have tried both values.
I have been googling for days now.
|
|
|
|
|
..hi is me again..ya..i know it is weird and wrong in this code..i really no any idea that write function in sql statement...i only thing i think was i show time and date in textbox..then date and time in text box will insert in to database..in logintable..the time data type i change to text box...this method can work??i really have no idea how to add function in database.."...thanks for the reply..
|
|
|
|
|
The TextBox doesn't store the date/time in the database, your code does. A TextBox just displays the String equivilent of the value of a variable. You should NOT be storing dates and times in your database as Strings.
|
|
|
|
|
If I had a dollar for everytime I've answered this guy, I'd have his annual salary.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Sometimes, no matter how many time you hit the nail...
|
|
|
|
|
Hi all,
I have a control which can be used to select a file and upload / save to server. I am looking for a method which checks whether the file exists in the source machine.
Provided:
1> I can key in the name of the file
2> some times i may not enter full path, just filename only
Any clues will be appreciated
Thanks
Sebastian
|
|
|
|
|
Is this an ASP.NET (Web Forms) or Windows Forms app??
|
|
|
|
|
I'm not sure about server side, but if you have Application and you want to check from there then use :->
Dim fileExists As Boolean<br />
fileExists = My.Computer.FileSystem.FileExists("C:\Test.txt")
And when you have only file name
<br />
Dim files As ReadOnlyCollection(Of String)<br />
files = My.Computer.FileSystem.GetFiles("C:\", True, "*.txt")<br />
Hope it helps.
- Stop thinking in terms of limitations and start thinking in terms of possibilities -
|
|
|
|
|
I have been trying to use click once deployment to deploy a 3 tire .net widows forms application. All seams to work fine apart from one very important aspect. As this application use Nhibernate for all database tasks, one of the Nhibernate configuration files is not being copied across. I have tried copying this file in both the configuration and resource folder and although this will include the folder and file in the deployment and copy the folder across with the configuration file in the folder, however, the application fails, as the application can not locate the configuration file.
The question is, can you copy none compliable files and include them in the deployment that when installed the file in question will be located with the application executable and assembly files?
|
|
|
|
|
You can set the config file to be a prerequisite in the publish area (I think)
|
|
|
|
|
Hello All!
I have a string with two delimeters ['a' and 'b'] which looks like...
a688899987788866766655555444330000000300FFFFFFFFD
aF00000000000000000000000000000AAABB8500FFFFFFFFD
a000000000000000000000000000000666567400FFFFFFFFD
bF000000000000000000000000000008AABAA700FFFFFFFFD
bF0000000000000000000000000000079AAA9800FFFFFFFFC
aF00000000000000000000000000000A98BA9700FFFFFFFFC
b000000000000000000000000000000EEEFFEE00FFFFFFFFB
a000000000000000000000000000000EEFFFFF00FFFFFFFFC
bF00000000000000000000000000000EEEEFED00FFFFFFFFC
a000000000000000000000000000000BCDDEDA00FFFFFFFFD
bF00000000000000000000000000000BDEDDDA00FFFFFFFFC
b000000000000000000000000000000666654400FFFFFFFFD
I want to split this string into two arrays of strings. One array should contain strings which started with 'a' and other array should contain strings started wih 'b'.
Is there any way to use VB Split function in this scenario. Please guide me with some suggestion or sample code.
Thanks
colgateas900197
|
|
|
|
|
Try this:
Dim strSrc As String = "a9837498393874b8374683746386a8279323879b92837"<br />
<br />
Dim strDelim As String = "ab"<br />
Dim arrStrItem As String()<br />
<br />
arrStrItem = strSrc.Split(strDelim.ToCharArray)<br />
Ask not whether it is useful. Ask what it is useful for.
|
|
|
|
|
Sorry,
code you have provided works for creating a single array of strings for all substrings.
My problem is to store all sustrings started with delimeter "a" should be stored in one array of strings and all sustrings started with delimeter "b" should be stored in another array of strings.
So that i can get two arrays of strings from the string provided.
Thanks for your consideration
colgateas900197
|
|
|
|
|
I misunderstood the question... so let me ask you this:
The string you have; is that one long string a###b########b##### or does it contain line breaks? Like the one you displayed?
a688899987788866766655555444330000000300FFFFFFFFD
aF00000000000000000000000000000AAABB8500FFFFFFFFD
a000000000000000000000000000000666567400FFFFFFFFD
bF000000000000000000000000000008AABAA700FFFFFFFFD
bF0000000000000000000000000000079AAA9800FFFFFFFFC
aF00000000000000000000000000000A98BA9700FFFFFFFFC
b000000000000000000000000000000EEEFFEE00FFFFFFFFB
a000000000000000000000000000000EEFFFFF00FFFFFFFFC
bF00000000000000000000000000000EEEEFED00FFFFFFFFC
a000000000000000000000000000000BCDDEDA00FFFFFFFFD
bF00000000000000000000000000000BDEDDDA00FFFFFFFFC
b000000000000000000000000000000666654400FFFFFFFFD
Ask not whether it is useful. Ask what it is useful for.
|
|
|
|