Thursday, March 10, 2011

Reset Visual Studio 2008 Settings

after i upgraded my VS2010 to SP1, i found that it caused the conflict to my VS2008 Setting.

when i try to add a Web Service Reference to the Project. a warming windows poping up and prevent me

to add a new web service.

"the Web Service Enumeration Component is Missing, please re-install VS2008 Etc.;..........


after I search on the MSDN, here is the simple solution to fix the this issue.


go to VS2008 Folder in the program menu, select VS2008 CMD, right click on it and select run as an administrator (this is very important, only the administrator can modify the setting in Windows 7 OS)

in CMD execute this line devenv.exe ResetSkipPkgs ( to load all skip tags)  or  devenv.exe ResetSettings (reset the VS2008 back to Default setting).

i hope this can save you a day....


Thursday, March 3, 2011

Upload File to AS400 Server with C#

if you implement a ftp upload feature to send file to AS400 via FTP.

here are couple of things necessary to make the program working

the format of address much be separated with double Quote between host address, Library and destination file.

 Dim fi As New FileInfo(localFileName)
 Dim ub As UriBuilder = New UriBuilder
 ub.Host ="HostAddress/"
 ub.Scheme = URI.UriSchemeFtp
 ub.Path = String.Format("{0}/%2F{1}.file""/QSYS.LIB/%2FFTPTEMP.LIB",
 fileName.Replace(System.IO.Path.GetExtension(ftpUpload.PostedFile.FileName), "")) 
 
QSYS.LIB is the default system library.
FTPTEMP.LIB is the destination upload folder.