
- DataGridView Control
- Windows Forms
Always Learning
Public Class NotSelectableButton
Inherits Button
Public Sub New()
MyBase.New()
' following line will make this button Not Focusable
SetStyle(ControlStyles.Selectable, False)
End Sub
End Class
My.Computer.Network.UploadFile("C:\SomeFile.txt", "ftp://ftpsite/somefile.txt", "userid", "pwd")So I Googled about that error and found some dicussion on MSDN forums.
Private Sub UploadFile(ByVal sDestination As String, ByVal sSource As String, ByVal sUserID As String, ByVal sPassword As String)
Dim i As System.Net.FtpWebRequest
Dim us As System.IO.Stream
Dim filebytes As Byte()
' create the FTP Web Request
i = System.Net.WebRequest.Create(sDestination)
' set credentials
i.Credentials = New System.Net.NetworkCredential(sUserID, sPassword)
' method = Upload File
i.Method = System.Net.WebRequestMethods.Ftp.UploadFile
i.UsePassive = False
i.Proxy = Nothing
' get the Request Stream
us = i.GetRequestStream()
' get the file bytes from source
filebytes = My.Computer.FileSystem.ReadAllBytes(sSource)
' write the bytes in stream
us.Write(filebytes, 0, filebytes.Length)
' close the stream
us.Close()
End Sub
function createlog(param1, param2) {
var xmlHttp;
try
{ // Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{ // Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("Your browser does not support AJAX!");
return false;
}
}
}
try
{
var u;
u = "createlog.aspx?param1=" + param1 + "¶m2=" + param2;
xmlHttp.open("POST", u, false);
xmlHttp.send(null);
return true;
}
catch (e)
{
return false;
}
}
<a href="http://www.domain.com" onclick="return createlog(1, 2);">www.domain.com</a>
function createlog(param1, param2) {
var u = "createlog.aspx?param1=" + param1 + "¶m2=" + param2;
(new Image).src = u;
return true;
}