Hi Digi, thatnks for the reply. The function is awesome. it works like charm ^^ BTW, i just find out another solution, to share with you guys here =D I used webclient class, there is a readopen() method to achieve this. here is a sample class which i get from msdn. Public Class Test Public Shared Sub Main(args() As String) If args Is Nothing OrElse args.Length = 0 Then Throw New ApplicationException("Specify the URI of the resource to retrieve.") End If Dim client As New WebClient() ' Add a user agent header in case the ' requested URI contains a query. client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)") Dim data As Stream = client.OpenRead(args(0)) Dim reader As New StreamReader(data) Dim s As String = reader.ReadToEnd() Console.WriteLine(s) data.Close() reader.Close() End Sub 'Main End Class 'Test :-D
kevindotnet
Posts
-
how to open an URL and save the content? -
how to open an URL and save the content?Is there any way to make a .net webpage, and in the server script to grab the URL and save the content to actual HTML file?
-
javascript problem with Mozilla and IEIt works fine in IE, but seems nothing happens in Mozilla. COuld anyone help me out? There is a tree view of displaying Catagory and sub-catagories. they are both read from database. Anyhow it has no effect in firefox mozilla. help.. The codes are here: function opencat(cat,img) { if(cat.style.display=="none"){ cat.style.display=""; document.images[img].src="images/class2.gif"; } else { cat.style.display="none"; document.images[img].src="images/class1.gif"; } } <% dim rss,rs2,ii,i set rss = server.CreateObject ("adodb.recordset") set rs2 = server.CreateObject ("adodb.recordset") sql="select * from gb_category" rss.open sql,conn,1,1 if rss.eof and rss.bof then response.write "No Main Category" else i=1 do while not rss.eof %> <% rss.movenext i=i+1 loop end if rss.close set rs2=nothing set rss=nothing %>
[000 src="images/class1.gif" align=absMiddle><%=rss("cat_name")%>](javascript:void(0);)
000 style="DISPLAY: none"> <% rs2.open "select * from gb_sub_category where cat_id=" & rss("cat_id"),conn,1,1 if rs2.eof and rs2.bof then response.write "No Sub Category" else ii=1 do while not rs2.eof %>
"> <%=rs2("sub_cat_name")%>
<% rs2.movenext ii=ii+1 loop end if rs2.close %> -
Encryption Textyou could write your own algorithm to encrypt the msg, a simple idea is: use 001 to represent A, 010 to B, 011 to C ...... if you want it more complex and secure, you could refer to the RSA key pairs, to build your algorithm. Cheers,Kev
-
Control array problems! help plzHi Steve, ur code only checks a single combox and returns false if the control text is empty. I add a integer to count, and make sure all the boxes are checked. Add 1 if it is not empty. Private Function checkCbos() As Boolean Dim myControl As Control Dim count As Integer = 0 For Each myControl In Me.Controls If TypeOf myControl Is ComboBox Then If myControl.Text = "" Then 'Set error provider errorPro.SetError(myControl, "Do not leave box empty!") 'Return False and exit to calling procedure Else 'Clear the error provider errorPro.SetError(myControl, "") count += 1 End If End If Next myControl 'If code gets to here, no combo's text is "" If count = 6 Then Return True Else Return False End If End Function
-
Control array problems! help plzThanks Mike and Steve,i got the point, that is very helpful.
-
Control array problems! help plzHi guys: I create a form with a bunch of combo boxes, and i named them with: cbo0,cbo1,cbo2..... I would like to create a function to test if any of them is empty. So i did it this way: Dim combos(6) As Object Dim cnt As Integer Form_Load() Handles MyBase.Load For cnt = 0 To 6 combos(cnt) = "strLand" & cnt.ToString Next End Sub Private Function checkCbos() As Boolean Dim cbos As ComboBox For cnt = 0 To 6 cbos = CType(combos(cnt), ComboBox) If cbos.Text = "" Then errorPro.SetError(cbos, "Do not leave the factor box empty!") End If Next End Function and after all this, i countered a casting error, could anyone helps me to debug this, or have a better idea to validate those combo boxes?thanks very much. Cheers Kevin