15,905,781 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by r.abhaysinghania (Top 20 by date)
r.abhaysinghania
31-Mar-17 1:53am
View
Yea it would be better and an easy way but this was a project given to me and my team mates.
r.abhaysinghania
30-Mar-17 3:13am
View
- System
- Provider
[ Name] Service1
- EventID 0
[ Qualifiers] 0
Level 4
Task 0
Keywords 0x80000000000000
- TimeCreated
[ SystemTime] 2017-03-30T06:30:06.000000000Z
EventRecordID 5137
Channel Application
Computer t_Ext.Siy.co.in
Security
- EventData
Service started successfully.
this is the event log in event viewer
I didn't understood much from the above event viewer
r.abhaysinghania
29-Mar-17 5:48am
View
Will change it and try again. thank you.
r.abhaysinghania
27-Mar-17 2:07am
View
I saw the link you gave but I m not authorize for the same.
r.abhaysinghania
25-Mar-17 6:22am
View
ERROR: //Unable to cast object of type 'System.Net.FileWebRequest' to type 'System.Net.FtpWebRequest'.
class ftp
{
private string host = null;
private string user = null;
private string pass = null;
private FtpWebRequest ftpRequest = null;
private FtpWebResponse ftpResponse = null;
private Stream ftpStream = null;
private int bufferSize = 2048;
/* Construct Object */
public ftp(string hostIP, string userName, string password) { host = hostIP; user = userName; pass = password; }
/* Download File */
public void download(string remoteFile, string localFile)
{
try
{
/* Create an FTP Request */
ftpRequest = (FtpWebRequest)FtpWebRequest.Create(host + "/" + remoteFile);// error here
/* Log in to the FTP Server with the User Name and Password Provided */
ftpRequest.Credentials = new NetworkCredential(user, pass);
/* When in doubt, use these options */
ftpRequest.UseBinary = true;
ftpRequest.UsePassive = true;
ftpRequest.KeepAlive = true;
/* Specify the Type of FTP Request */
ftpRequest.Method = WebRequestMethods.Ftp.DownloadFile;
/* Establish Return Communication with the FTP Server */
ftpResponse = (FtpWebResponse)ftpRequest.GetResponse();
/* Get the FTP Server's Response Stream */
ftpStream = ftpResponse.GetResponseStream();
/* Open a File Stream to Write the Downloaded File */
FileStream localFileStream = new FileStream(localFile, FileMode.Create);
/* Buffer for the Downloaded Data */
byte[] byteBuffer = new byte[bufferSize];
int bytesRead = ftpStream.Read(byteBuffer, 0, bufferSize);
/* Download the File by Writing the Buffered Data Until the Transfer is Complete */
try
{
while (bytesRead > 0)
{
localFileStream.Write(byteBuffer, 0, bytesRead);
bytesRead = ftpStream.Read(byteBuffer, 0, bufferSize);
}
}
catch (Exception ex) { Console.WriteLine(ex.ToString()); }
/* Resource Cleanup */
localFileStream.Close();
ftpStream.Close();
ftpResponse.Close();
ftpRequest = null;
}
catch (Exception ex) { Console.WriteLine(ex.ToString()); }
return;
}
}
// Instantiate ftp class with parameters
ftp myFTP = new ftp("//192.168.1.10", "(username)", "(password)");
// Download the file
myFTP.download("//192.168.10.100", "/temp/stock/stock12800");
r.abhaysinghania
25-Mar-17 2:33am
View
Actually i was not able to understand how to transfer the above( Which runs on batch file) to the code which runs on ftp directly.Thats y i was said I was not able to.
And thank you for the help, I will try the above code.
r.abhaysinghania
23-Mar-17 6:11am
View
I need to use ftp instead of that bacth file to transfer the data. and i found the first code on code project but was not able to use it in my code.
r.abhaysinghania
23-Mar-17 3:43am
View
I figured it later on and its running thank you
r.abhaysinghania
21-Mar-17 2:45am
View
thank you guys for the help.
r.abhaysinghania
20-Mar-17 8:26am
View
thank you for the help guys... I was searching about the UNC on cmd and found some thing on msdn that cmd does not support UNC.
r.abhaysinghania
20-Mar-17 7:24am
View
I already have the mapped drive. named Common(\\192.168.124.30\IT)(X:)
r.abhaysinghania
20-Mar-17 6:59am
View
I tried mapping a letter to the unc like this @"Z:\\192.168.124.30\IT\WebCommon\webfolder";
r.abhaysinghania
20-Mar-17 6:56am
View
a windows service is running a bat file via cmd , now i m trying to make it run on network server.
r.abhaysinghania
20-Mar-17 6:53am
View
okay, is it possible to solve that?
r.abhaysinghania
17-Mar-17 3:07am
View
what is service execution helper? as i m getting an error in that
r.abhaysinghania
16-Mar-17 7:52am
View
I have done that. cmd did a roll back and said the service is already installed
An exception occurred during the Install phase.
System.ComponentModel.Win32Exception: The specified service already exists
The Rollback phase of the installation is beginning. See the contents of the log file for the C:\Users\Sapuser\Documents\Visual Studio 2013\Projects\WindowsService1\WindowsService1\bin\Debug\WindowsService1.exe assembly's progress. The file is located at C:\Users\Sapuser\Documents\Visual Studio 2013\Projects\WindowsService1\WindowsService1\bin\Debug\WindowsService1.InstallLog. Rolling back assembly 'C:\Users\Sapuser\Documents\Visual Studio 2013\Projects\WindowsService1\WindowsService1\bin\Debug\WindowsService1.exe'. Affected parameters are: logtoconsole = assemblypath = C:\Users\Sapuser\Documents\Visual Studio 2013\Projects\WindowsService1\WindowsService1\bin\Debug\WindowsService1.exe logfile = C:\Users\Sapuser\Documents\Visual Studio 2013\Projects\WindowsService1\WindowsService1\bin\Debug\WindowsService1.InstallLog Restoring event log to previous state for source WinService. The Rollback phase completed successfully. The transacted install has completed. The installation failed, and the rollback has been performed.
r.abhaysinghania
10-Mar-17 5:33am
View
Deleted
when my teacher allows me to work on multiple batch files and if i stuck any where i will get back to you!!.
thank you
r.abhaysinghania
10-Mar-17 5:10am
View
how is it possible i tried with coping and pasting the code but the load increased. is there any way to reuse the above code for input of multiple batch file?
r.abhaysinghania
10-Mar-17 5:06am
View
can i ask one more question?
is it possible to run multiple bat files with reusing the above code instead of making more methods? or coping and pasting the code?
r.abhaysinghania
10-Mar-17 4:56am
View
Thank you for the help!!!. It Worked @Graeme_Grant
Show More