Free & Easy Access to PCs from Anywhere

Saturday, April 18, 2009

 

www.LogMeIn.com

 

A function to remove the cache problem with ftp

 

Public Function SaveReadMeFile(ByVal host As String, ByVal ftpusername As String, ByVal ftppassword As String, ByVal localpath As String)

Dim cp As New Cache.RequestCachePolicy(RequestCacheLevel.NoCacheNoStore)

'Create a request

Dim URI As String = host

Dim ftp As System.Net.FtpWebRequest = CType(System.Net.FtpWebRequest.Create(URI), System.Net.FtpWebRequest)

'Set the credentials

ftp.Credentials = New System.Net.NetworkCredential(ftpusername, ftppassword)

'Turn off KeepAlive (will close connection on completion)

ftp.KeepAlive = False

'we want a binary

ftp.UseBinary = False

'Define the action required (in this case, download a file)

ftp.Method = System.Net.WebRequestMethods.Ftp.DownloadFile

ftp.CachePolicy = cp

'If we were using a method that uploads data e.g. UploadFile

'we would open the ftp.GetRequestStream here an send the data

'Get the response to the Ftp request and the associated stream

Using response As System.Net.FtpWebResponse = CType(ftp.GetResponse, System.Net.FtpWebResponse)

Using responseStream As IO.Stream = response.GetResponseStream

'loop to read & write to file

Using fs As New IO.FileStream(localpath, IO.FileMode.Create)

Dim buffer(2047) As Byte

Dim read As Integer = 0

Do

read = responseStream.Read(buffer, 0, buffer.Length)

fs.Write(buffer, 0, read)

Loop Until read = 0 'see Note(1)

responseStream.Close()

fs.Flush()

fs.Close()

End Using

responseStream.Close()

End Using

response.Close()

End Using

Return True

End Function

 
 
'''how to use the function
 
 

Dim tmp As Boolean = False

tmp = Me.SaveReadMeFile(vsFtpZipPath & vguid & "/out/readme.xml", vftpUsername, vftpPassword, vsLocalZipPath & "readme.xml")


Downloading a file from ftp



'DOWNLOAD xml file FROM WEB(FTP) to the local folder

My.Computer.Network.DownloadFile(vsFtpZipPath & vguid & "/synchronization.zip" , vsLocalZipPath & "\" & "synchronization.zip", vftpUsername, vftpPassword)

SSL Links

Types of NLB


Acceleration Algorithms Supported:

  • Fastest response
  • Least connections
  • Round robin
  • Weighted round robin

Persistence Methods Utilized:

  • Cookies
  • Sticky connections
  • Header match rules

LINQ to Oracle

what diff between asp.net wesite and asp.net web application






Difference between asp.net website and application

How do I raise a keypress event programatically inside of a controls key event?

http://www.pinvoke.net/default.aspx/user32.SendMessage

http://www.developerfusion.co.uk/show/34/3/

Solution for Long Delay on First Request to ASP.NET 2.0 Application

http://blogs.msdn.com/jamesche/archive/2008/01/08/update-on-slow-startup-fix.aspx
post regarding slow startup of ASP.NET 2.0 applications
online automated system.

External JS reference

usually use the following code to reference an external JavaScript file and it works fine with ASP. NET 1.1, hope it works fine with you.

Page.RegisterClientScriptBlock(string key, string script);

This peace of code register a client side JavaScript block with "Script Key" (If this is already registered then previous f.js file will be replaced) and script -- external file that is referenced.

if(Page.IsClientScriptBlockRegistered(string key))

this peace of code checks if script block is registered or not.

after that JavaScript fucntion can be called from the C# code, some what like this.

button1.Attributes.Add("onClick", "javascript:return function name();");

Scheduling webpart

http://www.componentsource.com/features/calendar-schedule/sharepoint/index.html

Disable Prompt on File download

Response.AddHeader("content-disposition", "inline; filename=AppraisalView.txt")
Response.ContentType = "text/plain"
Response.WriteFile("C:\Inetpub\wwwroot\TestApp\AppraisalView.txt")
Response.Flush()
Response.End()

windows services

http://www.developer.com/net/csharp/article.php/2173801


http://articles.techrepublic.com.com/5100-3513-5784748.html

world time web service

http://www.quantumsoftware.com.au/ProductsServices/WorldTimeWebService.aspx

Free UML tool

www.tracemodeller.com

Analysis Tools

NDepend (www.ndepend.com)
Powerful quite complex (and slow) but not free. If you don't pay for it you cannot export anything.
It supplies a great code query feature, but you can't really take advantage of it without a license.

Dependency Structure Matrix PlugIn for .NET Reflector (http://tcdev.free.fr/ )
This is really cool and it's free! Much easier then nDepend in evaluating dependency structure indeed it's definitely faster.

Source Monitor (http://www.campwoodsw.com/sourcemonitor.html)
Free and easy. Can be used in order to calculate metrics that can be exported to XML.

VisualStudio 2008 Code Analysis or FxCop
Depending on the environment you are currently in you can use MS FxCop or its integration with Visual Studio 2008.

DevAdvantage (http://www.anticipatingminds.com/content/Products/devAdvantage/devAdvantage.aspx )
If you are dealing with .NET 1.1 and Visual Studio 2003 this tool can help analyzing code (also for naming convention). It can also be used in order to automatically correct violations.
Anticipating Minds it's not doing business anymore, so devAdvantage it's now free.
At present we haven't really used it. Maybe when we'll play the build phase of the project.

CodeIt.Right (http://submain.com/?nav=products.cir)
Similar to DevAdvantage but also available for the .NET 2.0 environment. The tool is now at the beta stage.
Same thinking as for DevAdvantage: I cannot say much of it.


Compuware DevPartner Studio ( http://www.compuware.com/solutions/default.htm)
Last but not least DevParter Studio.
Simply the best! It's not really code analysis, but performance analysis (that I think it's essential in an architecture assessment).
I've used it on the .NET 1.1 platform and I know that the last edition added many features like Memory Analysis, Source Code Review, Error Detection and Diagnosis.

.NET Technical Links 1

http://www.csharp-station.com/Tutorials/Lesson14.aspx
www.codeproject.com
www.codezone.com
www.asp.net
www.codeplex.com
www.dotnet2themax.com
www.interfaceconcepts.com
www.developeriq.com
http://pcquest.ciol.com
www.4guysfromrolla.com
https://mcp.microsoft.com/mcp/benefits/Default.mspx
http://www.csharp-station.com

LinkWithin

Blog Widget by LinkWithin

Recommended Books