Solved

Change the file extension from .html to .mht

Posted on 2006-11-14
5
214 Views
Last Modified: 2010-04-16
hi experts,
  I m developing one small application in vb.net which should work in the following way.
     I do have on textbox & one command button on my form. What i wanted do is, I will type some url's in that textbox with extension .html, Whenever i will press the command button the url's that i have typed, should convert their .html extension to .mht & should get saved in my hard drive ie it should search a pages from the net that i have typed & should save that pages with .mht extension.

Anybody having idea plz help.

it's urgent

thanx
0
Comment
Question by:s_monani
  • 3
5 Comments
 
LVL 5

Expert Comment

by:jalalmegadeth
ID: 17944905
so if i understood your question, u want a script that finds the .html, and replaces it by .mht

it's kind of find and replace

take a look at this page, you may find the answer :
http://www.codeproject.com/useritems/findandriplace_rtb.asp

and here's the function you may need :



Public Class RichTextBoxFR
    Inherits RichTextBox
   
    Public Sub FindAndReplace(ByVal FindText As String, ByVal ReplaceText As String)
    Me.Find(FindText)
            If Not Me.SelectionLength = 0 Then
            Me.SelectedText = ReplaceText
            Else
            MsgBox("The following specified text was not found: " & FindText)
            End If
    End Sub
   
End Class


GL


0
 
LVL 1

Author Comment

by:s_monani
ID: 17946678
thanx for reply sir,
  But it is not exactly i wanted. This code will just replace the specified string to other.
Let u have one example.
  Consider i m opening www.yahoo.com page in browser, So by using my application it should save this page with .mht extension.
 I hope u have got it now
thanx
0
 
LVL 4

Accepted Solution

by:
hclgroup earned 500 total points
ID: 17947739
0
 
LVL 1

Author Comment

by:s_monani
ID: 17962559
Thanx it's working great

Thanx again
0
 
LVL 1

Author Comment

by:s_monani
ID: 17971079
hi hclgroup,
 One problem has arose in that code.  This code saves the home page to the harddisk, means if i will save the file, then it saved in the format of .mht, but when i opened it, it direclty opens the live page of that file, means it do not open it from myh harddisk.  For example, i m saving the the google page file in the google.mht  format in my c drive (c:\google.mht), but when i open it, the address in the address bar is www.google.com instead of c:\google.mht.  I don't want in this format. Is there any other way out.

Plz help.
plz send me the solution at subunotes@yahoo.co.in as soon as possible. It's urgent
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Object Oriented Programming, C#, referencing, scoping. 13 86
Bot application - advice 3 64
statistics basics sources 2 41
Mutiple Folder view (5 Folder view) 3 54
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question