|
k.giannis_1980 wrote: Is there something like <<dim out="" as="" streamwriter="New" streamwriter("\\192.168.0.10\c\output.txt")="">> or <<\\computer_name\c\output.txt>> ????
Yes. What you described are the UNC paths to the server, share name, and file system path to a file. Saving the file is no different than if the path was C:\something. The code is exactly the same, just a different way of describing the filepath.
\\servername\sharename\folder\folder\filename
or
\\ipAddress\sharename\folder\folder\filename
|
|
|
|
|
Thank you so much!
It worked perfectly.
Thank you again for your fast reply
|
|
|
|
|
I have an application that has worked happily for many years under VB2003.
Today I upgraded it to VB2005 with no upgrade issues or changes.
The following line now fails
dim datestr as string = "7thNovember1993"
dim datedate as date
datedate = System.DateTime.Parse(datestr)
VB2005 throws
The string was not recognized as a valid DateTime. There is a unknown word starting at index 1.
TOPSie
|
|
|
|
|
You now have to use DateTime.ParseExact[^] and supply the format string that describes the format in which it should expect the date. Read the link I supplied, near the bottom, for an in-depth description of how ParseExact works and creating custom format strings to tell the parser what to expect.
|
|
|
|
|
Thanks for this - what a giant leap - backwards.
If I understand this then 7 November 1993 has a format string of "d MMMM YYYY"
But all my dates (and the data has LOTS of them) are in the format
7th November 1993. I can find nothing in your link that shows me a format to cope with "th" (or "st" or "rd"). I presume I am going to have to strip these out of the input string myself - being careful with AuguST etc.
As I said a great leap forward - one line of code turns in to 10 or more!!!
STOP PRESS
The original error was in DateTime.Parse coping with "7th November 1993"
Following your link I tried ParseExact with a format string of "d MMMM YYYY"
after stripping the "th" out. But ParseExact returned an error.
However going back to just Parse with no "th" in the date string now seems to work.
Thanks again
TOPSie
-- modified at 13:25 Friday 29th June, 2007
TOPSie
|
|
|
|
|
TotalTops1972 wrote: Thanks for this - what a giant leap - backwards.
Not really. This method is more flexible than what it used to be.
TotalTops1972 wrote: But all my dates (and the data has LOTS of them) are in the format
7th November 1993.
This is a really bad format. Sure it's human readable, but it makes it a PITA to use in automated data processing. Forget searching the database between date ranges. This is a string of characters that looks like a date. It's not actually a date value.
|
|
|
|
|
I appreciate your reply, it is a human format. This is raw data which originates from written documents, once upon a time they were handed copied, then scanned, now I get it electronically, but it from a printed document intended to be read by real people!
My program is reading this raw data and immediately converting it into a useful computer format so I can use it - but I have to take the original data in the format it is written.
Thanks to your help I have now got this initial conversion code working in at least one path - just hit another, but now I know how to fix it then it is just a slog to spot all the conversion paths..
My step backwards remark is aimed at Microsoft - backwards compatibility is something they often don't rate too highly.
Thanks again....
TOPSie
|
|
|
|
|
I'd look into using a Regular Expression to get the date string at least partially normalized so ParseExact has a better shot at it.
|
|
|
|
|
I found a way to cope with 'th', 'st', 'nd' and 'rd'. It's not that pretty but if you wrap it up into a function you've got a workable solution. It would be nice if you could just ignore characters, then you could use something like "d##MMMMyyyy" where # would be a character that's ignored. However, I couldn't find anything in the documentation that would lead me to believe that's possible. Anyway here you go.
' Valid date formats
Dim validFormats As String() = {"d'st'MMMMyyyy", "d'nd'MMMMyyyy", "d'rd'MMMMyyyy", "d'th'MMMMyyyy"}
Dim myDate As Date = Date.ParseExact("1stDecember1993", validFormats, Globalization.CultureInfo.CurrentCulture, Globalization.DateTimeStyles.None)
Your original post showed no spaces for the date...it was 7thNovember1993. If that's not the case just add appropriate spaces into the formatting strings and it should work.
|
|
|
|
|
Hi All,
I have made my custom textbox with different Properties,
I have in that Readonly Backcolor , Onfocus Backcoolor and so on. Also ReadOnly Forecolor, Onfocus Backcoolor and so on all such different Properties.
Now I want
BackColor--->
------------>OnFocus
------------>ReadOnly
------------>Normal
------------>Disabled
Now i want this to be under + sign , same as we have Font and with it we have
Font--->
------------>Bold
------------>Size
------------>Italics
------------>Family
How can I achieve this ??please help
Regards & Wishes
Navneet Hegde
Nashik(City Of Pilgrimage)
Develop2Program & Program2Develop
|
|
|
|
|
How to make custom property editors, here[^].
|
|
|
|
|
Hi,
I am using VS2005.I want to Read the Content from MS Word and MS Excel with out the help of
Word Object Library or Excel Object Library and Display to the Windows form in VB.Net.
Help me to Read the Content..
Thirukumar.
|
|
|
|
|
thirukumar wrote: I want to Read the Content from MS Word and MS Excel with out the help of
Word Object Library or Excel Object Library
Then what do you plan to use? Without using the Word and Excel object libraries, you just made your job about 100 times more difficult.
|
|
|
|
|
hey i need help in calculator program .... can any one send any artical or code on it
|
|
|
|
|
1. Please read the forum guidelines. Everyone here needs 'help' so please be more specific.
2. You are asking for general code that if you search hard enough you will probably find the code. Try Google.
3. This is a forum for people who are having problems with existing code to get help. Asking us for all the code you need is considered rude.
______________________
stuff + cats = awesome
|
|
|
|
|
Hey Ash...
Just begin yourself first, the way you see the calculatot u have around,
First with the User Interface.
Codeproject is always there to help you .
Regards and Wishes,
Navneet Hegde
Nashik(City Of Pilgrimage)
Develop2Program & Program2Develop
|
|
|
|
|
|
Please Post your Questions with Suitable Subject as Leckey said.
Calculator[^]
Regards,
Satips.
|
|
|
|
|
I am using the AJAX tab control on a page and it contains a DropDownList which is populated at runtime. When the page is refreshed at postback, the Dropdownlist is cleared. The Viewstate property is ON for DDL and the page. I am unable to understand why is this happening.
I have tried by putting the DDL outsite the Tabs with no luck.
Working under
Visual studio 2005
Microsoft windows Server2003
|
|
|
|
|
Ask this in the ASP.NET forum. You're question has nothing to do with VB.NET, even if it was the language you used to write the code in.
|
|
|
|
|
hi
friends
i have a peculair situation here.
i need to access the web page content from the internet explorer from my vb.net application.
previously i have done an application which takes url and parses it's content. this was damn easier. but the real shock was i got a thought that y cannot i access the web page content from the internet explorer without the url involved.
clear explanation
i open an ie browser. type in a url say "www.google.com" and the page loads into my browser. now i need to write an application in vb.net which can access the webpage content , here it's google webpage content(ie html content)
in short i need to do what ie provides(right click>view source)through my coding
there is no such thing as good or bad.
|
|
|
|
|
dear chiyankrishna,
are you trying to create a browser application in vb.net?
All The Best
Sathesh Pandian
|
|
|
|
|
yup
i have created a browser application in vb.net which just works like the ie browser. i placed a buuton at the menu bar which works exactly like the (right click>view source) way.
but the thing is i need to find a way to do it in the same way with the ie browser. here i want to do it from my vb.net application
there is no such thing as good or bad.
|
|
|
|
|
If you created a browser application, then you've already put a WebBrowser control on your form, correct? If so, you've already got the HTML source once the page is downloaded, just look in it's DocumentText property.
|
|
|
|
|