Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

anumadhu

@anumadhu
About
Posts
29
Topics
17
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • how to pass parameters to webclient.uploadFileAsyncEventHandler()
    A anumadhu

    Hello everyone, I am developing a module in C#.net3.0 on windows XP. I am downloading a file from the ftp server in asynchronous mode. Before the download completes, i am doing another Async download of another file by again creating the object of WebClient with the same name. I am handling the downloadFileCompleteEventHandler(Object sender, AsyncEventHandler e). Now i want to see which file download has raised this event handler. For this, i think i have to send file name as parameter to this downloadFileCompleteEventHandler(Object sender, AsyncEventHandler e) method. My code snippet is as follows: private void FtpToStagingServer(String spotID, Int32 Ctr) { //DOWNLOADING TO LOCAL DATABASE SERVER WebClient ccftp = new WebClient(); try { //Download from Clearcut Server ccftp.Credentials = new NetworkCredential(Username, Password); Uri CcFtp = new Uri("ftp://"+HostIp+"/Assets/"+spotID+".mpg"); ccftp.DownloadFileCompleted += new System.ComponentModel.AsyncCompletedEventHandler(ccftp_DownloadFileCompleted); ccftp.DownloadFileAsync(CcFtp, "C:\\AWS_FilesDownloaded\\"+spotID+".mpg"); tAssetId = spotID; } catch (WebException wes) { } catch (Exception es) { } // throw new Exception("The method or operation is not implemented."); } void ccftp_DownloadFileCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) { //Transfer the downloaded asset from Clearcut server to the Staging server/ MessageBox.Show(" Ftp from clearcut to local drive completed"); WebClient ssFtp = new WebClient(); try { ssFtp.Credentials = new NetworkCredential("abc", "abc123"); ssFtp.UploadFileCompleted += new UploadFileCompletedEventHandler(ssFtp_UploadFileCompleted); ssFtp.UploadFileAsync(new Uri("ftp://somehostIpwith path/"+ tAssetId+".mpg"), "C:\\AWS_cc_download\\" + tAssetId + ".mpg"); } catch (WebException wes) { } catch (Exception es) { } //throw new Exception("The method or operation is not implemented."); } I am trying it by taking a temporary

    C# csharp database sysadmin cloud tutorial

  • How to do Ftp from one server to another server directly
    A anumadhu

    Hello everyone, I am working on C#.net(3.0) in windows XP platform. I have a two different servers with FTP in it. I am developing a module in the above technology, in which, without i have to transfer a file from one FTP server to another FTP server, without using the local system. Now, i am downloading required file from the FTp-server1 to local system and then, from the local system i am uploading it to the other Ftp-server2. But, i want to do file transfer directly from the ftp-server1 to the ftp-server2, without using local system. could you please give me some hint or the required links that can help me in doing this. Any help is greatly appreciable. Thanks Anee

    C# csharp sysadmin help tutorial

  • Access of common thread by WCF service and windows service in c#.net 3.0
    A anumadhu

    Hello, I am developing a windows service using the WCF technology(this contains the windows service and also hosts a webservice) in C#.net3.0. I am developing this on the windows XP platform. Here, i have two class files WCFservice.cs and WindowsService.cs. There is a single thread declared, started (in OnStart()) and Aborted(OnStop()) methods of the WindowsService.cs file. Now, my requirement is to, suspend() and resume() the same thread in the WCFservice.cs file. since, the WCFservice class is inherited from IWCFservice and WindowsService class is inherited from the ServiceBase class, i am unable to fix my problem of accessing the same threadObj from both these files. Can anyone help me here... Thank you Anee.. Anee

    .NET (Core and Framework) csharp help wcf career

  • handling multi-threading in C#.net 3.0
    A anumadhu

    Hello, I am developing in C#.net 3.0 and here, i am using the multi-threading. Here i have 5 threads in the following way: One thread sleeps for x mins after completing its one iteration. Second thread sleeps for y secs after completing its one iteration. Third thread sleeps for x hours after completing its one iteration. Fouth thread sleeps for 1 day after completing its one iteration. And the fifth thread sleeps for r mins after completing its one iteration. All these threads have access to same database tables, sometimes they do reading and sometimes they do writing into the database table. 1) Here, I have an idea that, i have to lock the database. 2) And also, while debugging i have seen that, due to multi-threading there is an issue with the order of execution. Can anyone help me on this ..please.... everything is over and at the last minute.. this problem arised. Thanks Anee Anee

    C# help csharp database

  • how to access linux folder/files from windows operating system
    A anumadhu

    Hello, I am developed a windows service in c#.net3.0(WCF). There is a requirement, that, this service should spontaneously search for a file.mpg in linux folder. My service will run on the windows platform, there is an another service running on linux and creates .mpg file in its folder. Now my service has to search for the file in linux folder. Did anyone has met with the similar requirement ever? if so, how you have solved or met this. Please guide me on this. Thank you Anumadhu.K

    Anee

    System Admin csharp tutorial wcf linux question

  • windows service to process SOAP call in.net2005
    A anumadhu

    Thanks Mike, Task-1: It should be able to do query and update MySQL database in backend for every x number of seconds. Task-2: And meanwhile, if it receives the SOAP request, it should do the following activities: 1) The windows service should be able to receive and parse a SOAP Request over HTTP protocol 2) Query and update a MySQL database 3) After updating the database, it should send a message(example: "Your Request Processed")as SOAP Response or SOAP Envelope over HTTP protocol. Any related articles or the code samples in C#.net 2005, is of more help to me. Thanks Anee

    .NET (Core and Framework) csharp database mysql wcf xml

  • windows service to process SOAP call in.net2005
    A anumadhu

    Hello everybody, I have gone through lot many articles regarding the SOAP in webServices. I did many applications in the windows service in .net2005. Now my new requirement is to create a new windows service which can do two things: 1) it should be able to service a SOAP call by reading the MySQL db and generate a SOAP enevelpe. And 2) It should also run for every x-seconds/x-mins. I am carrying out this task in C#.net2005. And MySQL. Can anybody help me out in getting me the correct theory and code articles, because in my research.. i am getting deviated everytime. So, please can anybody help me out.. Thanks in Advance anumadhu Anee

    .NET (Core and Framework) csharp database mysql wcf xml

  • how to write xml in C#.net
    A anumadhu

    Hello Stefan!! Great thanks... Its works fine. Thank you Anee Anee

    XML / XSL csharp xml help tutorial

  • how to write xml in C#.net
    A anumadhu

    Hello, I did, like this.. and got the root element, in the way.. which my sample xml document contains. But i am not much sure, that whether the method that i followed is correct or not. please help me out in fixing whether this is right or not. This the piece of code, which i wrote to write the root node .. according to my requirement.. //writer.WriteStartElement("tns", "schedule", "http://www.MyCopmpany.com/Schedule"); writer.WriteStartElement("tns:schedule"); writer.WriteAttributeString("xmlns:tns", "", "http://www.MyCompany.com/Schedule"); writer.WriteAttributeString("xmlns:dt", "","http://www.MyCompany.com/DataTypes"); writer.WriteAttributeString("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); writer.WriteAttributeString("xsi:schemaLocation", "http://www.MyCompany.com/Schedule Schedule.xsd"); writer.WriteAttributeString("scheduleType", "Playback"); writer.WriteAttributeString("version", "1.0"); writer.WriteAttributeString("creationTime", "2006-01-29T00:00:00"); writer.WriteAttributeString("originator", "MyCompany"); writer.WriteStartElement("scope"); writer.WriteAttributeString("startTime", "2006-01-29T04:00:00".ToString()); writer.WriteAttributeString("stopTime", "2006-01-29T06:00:00".ToString()); writer.WriteEndElement(); //use the record structure int i = 0, count; count = xmlSlotNodes.Count; // sort the slots according to there callSign xmlSlotNodes.Sort(0,count,new Sorting ()); string[] prgmTime = new string[2]; ---- ---- Thank you Anee

    XML / XSL csharp xml help tutorial

  • how to write xml in C#.net
    A anumadhu

    Hello can anyone help me in getting the xml file's root node in the following format. Here Schedule is root node. I am using the XmlTextWriter class. - Can anyone help me in this regards... Thanks Anee Anee

    XML / XSL csharp xml help tutorial

  • writing XML in C#.net
    A anumadhu

    hello, I am new to both the xml and C#.net technologies. I am generating a xml file in c#.net.I am trying to generate a xml file whose first/root node should look like this: I am using the xmlWriter class to generate the xml. The data for xml is taken from the structure which is filled by the program itself. My code is as follows: private void generateXml() { TreeNode tempNode,selectedNode; frmFindByProgram.stProgram stTemp = new frmFindByProgram.stProgram(); selectedNode=new TreeNode(); tempNode = new TreeNode(); XmlTextWriter writer = new XmlTextWriter("E:\\Projects\\Project1\\July\\26\\ScheduleDemo\\NewXML.xml", new System.Text.UTF8Encoding()); //Write the header information writer.WriteStartDocument(); //Write the root node writer.WriteStartElement("tns", "schedule","http://www.sample.com/Schedule"); //use the record structure int i = 0, count; count = xmlSlotNodes.Count; // sort the slots according to there callSign xmlSlotNodes.Sort(0,count,new Sorting ()); string[] prgmTime = new string[2]; stTemp = (frmFindByProgram.stProgram)xmlSlotNodes[i]; selectedNode=getClickedNode(); writer.Formatting = Formatting.Indented; writer.WriteStartElement("CruiseLine"); // writer.WriteAttributeString("Id", selectedNode.Text ); writer.WriteAttributeString ("Name",selectedNode.Parent.Text); writer.WriteStartElement("Ship"); writer.WriteAttributeString("Name", selectedNode.Text ); writer.WriteStartElement("Channel"); writer.WriteStartElement("CallSign"); writer.WriteAttributeString("Value", stTemp.CallSign); prgmTime = stTemp.Duration.Split('-'); do { stTemp = (frmFindByProgram.stProgram)xmlSlotNodes[i]; pr

    XML / XSL csharp com algorithms xml

  • using the System::Collections::IEnumerator()
    A anumadhu

    Hello, I am trying to get current login user name using my own windows service program using VC++.Net 2005, windows XP. The code used to develop windows service contains only unmanaged one. But in order to retrieve the current login name.. i am using the help of System::Management class, for which i included necessary namespaces in its .cpp file. actually i am trying interpret the following statement of c# into c++: System::Management::Collections mc; foreach(System::Management::Object mo in mc){..do this..} my approach was somewhat like this in the following way: CString CUSBActivity::Get_User_Name() { CString Username=_T(""); System::Management::ManagementObjectSearcher^ q = nullptr; System::Management::ManagementObjectCollection^ mc = nullptr; System::Management::ManagementObject^ mo = nullptr; System::Collections::IEnumerator^ enu = nullptr; q = gcnew System::Management::ManagementObjectSearcher("Select * from Win32_Process"); mc = q->Get(); enu = mc->GetEnumerator(); mo = (System::Management::ManagementObject^)enu->Current; while(enu->MoveNext()) { DebugBreak(); mo = (System::Management::ManagementObject ^)enu->GetType(); Username = mo["username"]->ToString(); mc->GetEnumerator()->MoveNext(); } return Username; } But when i run this, i am getting the run time exception and the Username is null. Could anybody... assist me in fixing this thank u. Anee

    Managed C++/CLI csharp c++ help

  • Are there any certifications for C/C++ developers
    A anumadhu

    hi all, I am very much interested on c/c++ programming on windows o.s. So, is interested in upgrade myself my getting certifications in c/c++ development. As there are certifications like MCTS, Java certifications etc. Do we have any such certifications only intended for c/c++ developers on Windows platform. I am very much interested to know this. Please let me know of this information, if anybody have. If possible could you please get me the full details that is the all/some of the certification names, the syallabus and the fee structure. I don know the exact forum to post my question. so from the available ones, i found this as the right one. If not pls forgive me. Any help is greatly expected. Thanks in advance Anee

    Anee

    IT & Infrastructure c++ java help question

  • getting username from windows service in VC++.Net2005
    A anumadhu

    I have a windows service application. Created in windows XP and vc++.Net2005. I want this to make it work on windows 95,98,2K,XP and Vista. I want to get the username of the current logged-in user or users(if the user is switching between more than once loggin on the same machine) I have implemented it in this format: Added the refrences to my project that is using project properties from the toolbar. Now, wrote in this way: CString Get_Username() { CString Username=_T(""); System::Management::ManagementObjectSearcher q = gcnew System::Management::ManagementObjectSearcher("Select * from Win32_Process"); System::Management::ManagementObjectCollection mc = q.Get(); System::Management::ManagementObject mo = mc.GetEnumerator(); while(!mo) { Username = mo("username"); mo.Get(mc); } return Username; } i am getting the following compilation errors: .\DataSentinelService.cpp(80) : error C2664: 'System::Management::ManagementObjectSearcher::ManagementObjectSearcher(System::String ^)' : cannot convert parameter 1 from 'System::Management::ManagementObjectSearcher ^' to 'System::String ^' No user-defined-conversion operator available, or Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast .\myservice.cpp(81) : error C3673: 'System::Management::ManagementObjectCollection' : class does not have a copy-constructor .\myservice.cpp(82) : error C2664: 'System::Management::ManagementObject::ManagementObject(System::Management::ManagementPath ^)' : cannot convert parameter 1 from 'System::Management::ManagementObjectCollection::ManagementObjectEnumerator ^' to 'System::Management::ManagementPath ^' No user-defined-conversion operator available, or Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast .\myservice.cpp(84) : error C2088: '!' : illegal for class .\myservice.cpp(84) : fatal error C1903: unable to recover from previous error(s); stopping compilation I have also tested by placing the following lines in the starting of my myservice.cpp file: using namespace System; using namespace System::Management; But still the same kind of errors persists. I have even searched on net to get the exact cause of error/problem. In the msdn also, the code samples are given for VB.Net/C# but not for vc++/C++. Any idea please... Thanks in advance Anee

    C / C++ / MFC csharp c++ help

  • How to get Logged in user name using my own windows service application
    A anumadhu

    Hello friends... Thanks for your comments. I am taking help from the following article provided with Codeproject: http://www.codeproject.com/vb/net/Windows\_Service.asp What i understand from this is, we can have access to the WMI. This WMI shows all the information regarding the various processes running in machine. As i want to get the username in which i am currently logged-in, So, i am using the Win32_Process (which gives the name of process explorer... and the substring of, name of process explorer contains the currently logged-in username(eg.. user_nameprocess.exe) . Using string operations... i am trying to extract that particular username part of the process explorer name. Now,Taking help of this, i have added System.Management reference to my project (VC++.NET/windows XP) and then i got two files namely ROOT.CIMV2.Win32_Process.h/cpp with my project name. And in the ROOT.CIMV2.Win32_Process.cpp contains following lines of code: #include Stdafx.h #include ROOT.CIMV2.Win32_Process.h After this i added System refrence through the project properties. But while building this project, i am getting some errors in these new files ROOT.CIMV2.Win32_Process.h/cpp. and command line options are: C/C++ Command line options: /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /FD /EHa /MDd /Yu"stdafx.h" /Fp"Debug\myservice.pch" /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W0 /nologo /c /Zi /clr:pure /TP /errorReport:prompt /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Management.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll" Linker Command Line Options: /OUT:"D:\Apr\2\myservice\Debug\myservice.exe" /INCREMENTAL /NOLOGO /MANIFEST /MANIFESTFILE:"Debug\myservice.exe.intermediate.manifest" /DEBUG /ASSEMBLYDEBUG /PDB:"d:\Apr\2\myservice\debug\myservice.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 /FIXED:No /ERRORREPORT:PROMPT setupapi.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib And stdafx.h file looks like this: #pragma once #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers // TODO: reference additional headers your program requires here #define _AFXDLL /*I included this, bcoz if i don't, then i m getting an build error: D:\Microsoft Visual Studio 8\VC\atlmfc\include\afx.h(24) : fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version.

    C / C++ / MFC csharp c++ json tutorial

  • How to get Logged in user name using my own windows service application
    A anumadhu

    Hello, I am developing a windows service in VC++.Net2005 on windows XP. I want the end product should be portable to all the windows OS(atleast to win98,Me,2K,XP and Vista). In my windows service (which runs on Local System means as System's service), there is a requirement to access the current login user name. To get that i am using the GetUserName() of win32 API, but with this, i am only getting the Login-name as "SYSTEM" ( probably because of the reason that, my windows service is running in System's area(local system)). Is it feasible to get the current login name instead of getting the user in which the my windows service is running. If possible.. any clues.. Thank you

    Anee

    C / C++ / MFC csharp c++ json tutorial

  • Problem with connecting to MySQL db from my own windows service application
    A anumadhu

    Thanks to all specially to JudyL_FL.. who tried to help me out in fixing my problem. And there is a good news, the problem got fixed.... :) . Actually i am not sure that whether i m right or not in my analysis. What i did to solve this: I just created System DSN now and everything was same. And it worked fine, without any problem. Before this i using User DSN. The cause of problem would be: What i guess is, since the windows service which i am developing is a system service so it is failing to open MySQL db through the User DSN. :~ Am i right? or is there anything else which is causing the problem... Thanks in advance.

    Anee

    C / C++ / MFC database debugging help csharp c++

  • Does executable got from XP run on Windows Vista
    A anumadhu

    Hello, I have my own windows service application designed and developed on VC++.Net 2005 and windows XP. There to create service i made use of advapi32.dll(from c:\windows\system32..) and winsvc.h header file(got from windows.h) exe (of my own windows service application) developed on windows XP, do we have any problems to run that exe on Windows Vista's any edition. And also i used setupapi.dll/.h here. What i heard is, since windows vista is very strict in case of accessing/tampering with windows services, file access/creations, executing exe from other platform. So, i am bit confused.. Any comments please... Thank you.

    Anee

    Windows API csharp c++

  • Problem with connecting to MySQL db from my own windows service application
    A anumadhu

    Hello, After debugging what i found is that, the CDBException at the following statement raises an exception: cdb.openEx(szConnectstring, CDatabase::noODBCDialog) And the message throwed is: "Data source name not found and no default driver specified" Whereas when i check for this dsn's status..from control panel the test connection is showing success. And also i am using the same dsn and same database from other VC++.Net2005 application ( this is not a windows service application), this application is getting connected to MySQL database using the same dsn and also able to read the records from one of the tables there(which shown in the applications UI window). I am not creating the windows service using the .Net framework. I am creating the my windows service application using the winsvc.h and advapi32.dll. I guess, since the application from which i am trying to connect to MySQL database is a windows service application, so probably causing some problem (due to some hidden windows internals..issues).. which i am unable to fix... Can anybody.. help me out by giving the clues.. Thank you..

    Anee

    C / C++ / MFC database debugging help csharp c++

  • Problem with connecting to MySQL db from my own windows service application
    A anumadhu

    Hello, Now i can see the cause of CDBException. It shows that "Data source name not found and no default driver specified". I am with the administrative privileges in windows XP. And also the dsn connection is checked with MySQL ODBC driver. And also the same dsn is used with another application to check for its working.. and the dsn was working fine in that application(which is not a windows service..it is an ordinary VC++.Net2005 application). But i am unable to locate why this dsn is not accessible from my windows service application. :~ :confused: :suss: I guess, the dsn (of MySQL ODBC 3.51 driver) is not getting accessible from my windows service, probably because of some security issues or something else..which i am unable to see or fix.(probably related to windows internals) if anybody has atleast a clue... is greatly appreciable... Thanks in advance..

    Anee

    C / C++ / MFC database debugging help csharp c++
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups