|
How to move all files in a directory to another directory?
And how to rename directory and file?
|
|
|
|
|
I assume your talking about VB.Net and not VB6.
Check out the classes under the 'System.IO' namespace.
THeres some pretty obvious ones like 'File' and 'Directory'.
|
|
|
|
|
|
You should specify the language your asking about when posting in this forum.
Most people will assume VB.Net if you don't say which.
|
|
|
|
|
|
VB6 is a dead language. You should always specify that you want VB6 help, otherwise people will assume .NET.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I would like to me bold some part of String data type and make some part with color,using vb.net code.
Would you please help me to get that.
thanks,
RB
|
|
|
|
|
When adding Bold and Colour to a string you normally do it when its displayed.
If your displaying in the Console then check out the properties on the System.Console class.
If your making a WinForms app you'll want to look at the RichTextBox control.
|
|
|
|
|
How you do that depends upon the container that's showing the string. If it's a web browser, it's going to follow the HTML rules for formatting. If RTM, the method of formatting changes. If A TextBox, changes again...
What you want doesn't have any meaning as the String type doesn't support any kind of formatting. It's up to the container showing the string that dictates how this is going to be done.
|
|
|
|
|
Thanks for you help. Actually, I'm writing a window console program to send mails. Now, I want to make bold of Subject and make some body text with color. I'm using the String type for Subject and Body variables.
Please help me .
Thanks in advance !!
RB
|
|
|
|
|
Emails don't support any formatting in the subject line. You simply have no choice there.
Colorizing text in the body of the email would require that you send the body in either RichText format or as an HTML page. In either case, the receiver has to support that kind of email. HTML is easy. It's just like any other HTML page. Just use the correct HTML tags around the section you want to change color. There's HTML tag tutorials all over the web.
|
|
|
|
|
Dear Dave Kreskowiak,
Thanks for your help.Sorry to bother you again. I'm still comfused. Let me get clear. So, do I need to create a richtext box or HTML page?
|
|
|
|
|
Do you need to create a RichTextBox?? No. You just need to add the formatting codes to the string that will tell a RTB how to properly format your message.
You can either create a RichText document or an HTML page. The choice is up to you. HTML will probably be easier since the tags are nothing more than this: <b>bolded text</b>.
|
|
|
|
|
Hi,
I am using a session array, and I populate it like this:
Dim nodesArray() As String
Dim i As Integer = 0
For Each node As RadTreeNode In nodes
nodesArray(i) = node.Value
i += 1
Next
Session("NodesArray") = nodesArray
When I try to print the array count it gives me errors. Can someone please let me know hot to do this. I did it currently like this:
Dim nodesArray() As String
nodesArray = CType(Session("NodesArray"), String)
Response.Write("nodesArray.Length = " & nodesArray.Length)
Regards
ma se
|
|
|
|
|
There is an ASP.NET forum.
What is the error ? It looks to me like you're casting the variable to a string, instead of a string array. Does CTyle return a single string here, or Nothing ? I'd guess at the latter, hence the error ( which I assume is an object reference not set exception )
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
What's wrong with putting the question here?? It's VB code and this is a VB forum??
The error is:
C:\Inetpub\wwwroot\...\PowerSearch.aspx.vb(383): Value of type 'String' cannot be converted to '1-dimensional array of String'.
|
|
|
|
|
Yes, that's exactly what I said. You're casting to a string, instead of an array of strings.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I'm not sure how to do it?
|
|
|
|
|
I'm sorry, I could only guess, I don't do VB.NET. I would guess that instead of String, you need String() in your cast statement. Given that VB.NET is weakly typed, you may not need the cast at all, do you ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
normally string() should be enough
no need to cast it
|
|
|
|
|
Hai friends,
i am using tif images in my project.i am using picturebox to view the tif image one by one.i should know that how to go from one image to the next.plz help very urgent.
Thanks
|
|
|
|
|
if all images are in one folder, create an array of file names by using System.IO.Directory.GetFiles(path, searchpattern) and loop through arrays to get file name one by one.
Be a part of solution, rather then be a part of problem
|
|
|
|
|
can you see the tif image in your picture box?
its better to convert them to something compatible to imagelist and then using the index of image in imagelist you can change the image of picturebox.
A.E.K
|
|
|
|
|
1 - please try to use sensible headers
2 - just set a timer, store the names in an array, and read them one by one as the timer fires.
3 - don't say 'it's urgent', that means nothing. Everyone regards their problem as urgent.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I have an error : Padding is invalid and cannot be removed.
I want to decrypt a file but I receive that error.
My code looks like this:
Sub DecryptTextFromFile(ByVal Key() As Byte, ByVal IV() As Byte)<br />
Dim var As String = My.Application.Info.DirectoryPath + "\text.txt"<br />
<br />
Try<br />
' Create or open the specified file. <br />
Dim fStream As FileStream = File.Open(var, FileMode.OpenOrCreate)<br />
<br />
<br />
' Create a new Rijndael object.<br />
Dim RijndaelAlg As Rijndael = Rijndael.Create<br />
<br />
' Create a CryptoStream using the FileStream <br />
' and the passed key and initialization vector (IV).<br />
Dim cStream As New CryptoStream(fStream, _<br />
RijndaelAlg.CreateDecryptor(Key, IV), _<br />
CryptoStreamMode.Read)<br />
<br />
RijndaelAlg.Padding = PaddingMode.PKCS7<br />
<br />
<br />
<br />
' Create a StreamReader using the CryptoStream.<br />
Dim sReader As StreamReader = New StreamReader(cStream)<br />
<br />
dim var23 as String=sReader.ReadLine()<br />
<br />
<br />
<br />
'Read the data from the stream <br />
'to decrypt it.<br />
Dim val As String = ""<br />
Try<br />
<br />
val = sReader.ReadLine()<br />
<br />
Catch e As Exception<br />
MessageBox.Show("An error occurred: {0}", e.Message)<br />
Finally<br />
' Close the streams and<br />
' close the file.<br />
sReader.Close()<br />
cStream.Close()<br />
fStream.Close()<br />
<br />
<br />
End Try<br />
<br />
Catch e As CryptographicException<br />
MessageBox.Show("A Cryptographic error occurred: {0}", e.Message)<br />
'Return Nothing<br />
Catch e As UnauthorizedAccessException<br />
MessageBox.Show("A file error occurred: {0}", e.Message)<br />
'Return Nothing<br />
End Try<br />
<br />
<br />
End Sub
Thanks.
I search google but I didn't find something that can help me.
|
|
|
|