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
M

Michael101

@Michael101
About
Posts
39
Topics
20
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Command Prompt Calling and Parsing
    M Michael101

    Hey People how are you? I've got an ASP.NET (Built in VB.NET) web system and I need to talk to a program called IBM MQ. IBM MQ is sort of like BizTalk but I've been unable to find anyone that has been able to find out how to talk to MQ directly. To talk to MQ in general you can do it through the DOS Command Prompt by typing in commands and that works really well. My problem is that I don't know how to get my VB.NET web system to talk to Command Prompt and pass it arguments that I'll use to talk to MQ. If anyone has any code for opening and passing arguments into a command prompt that would be very much appreciated. Thank you very much in advance. Michael :)

    ASP.NET csharp asp-net json help

  • FTP Problem
    M Michael101

    Hi Everyone, I've got an FTP problem. I've been trying to make my own FTP program but it doesn't quite work and I'm not sure why. Dim FileName As String = xmlFileName Dim ftpServerIP = "202.62.33.220" Dim fileInf As New FileInfo(FileName) Dim uri As String = "ftp://" + ftpServerIP + "/" + fileInf.Name Dim reqFTP As FtpWebRequest ' Create FtpWebRequest object from the Uri provided reqFTP = DirectCast(FtpWebRequest.Create(New Uri("ftp://" + ftpServerIP + "/" + fileInf.Name)), FtpWebRequest) MsgBox("ftp://" + ftpServerIP + "/" + fileInf.Name) ' Provide the WebPermission Credintials reqFTP.Credentials = New NetworkCredential("MHR\administrator", "sbanks@#@") ' By default KeepAlive is true, where the control connection is not closed ' after a command is executed. reqFTP.KeepAlive = False ' Specify the command to be executed. reqFTP.Method = WebRequestMethods.Ftp.UploadFile ' Specify the data transfer type. reqFTP.UseBinary = True ' Notify the server about the size of the uploaded file reqFTP.ContentLength = fileInf.Length ' The buffer size is set to 2kb Dim buffLength As Integer = 2048 Dim buff As Byte() = New Byte(buffLength - 1) {} Dim contentLen As Integer ' Opens a file stream (System.IO.FileStream) to read the file to be uploaded Dim fs As FileStream = fileInf.OpenRead() 'Try ' Stream to which the file to be upload is written Dim strm As Stream = reqFTP.GetRequestStream() ' Read from the file stream 2kb at a time contentLen = fs.Read(buff, 0, buffLength) ' Till Stream content ends While contentLen <> 0 ' Write Content from the file stream to the FTP Upload Stream ******strm.Write(buff, 0, contentLen)********* contentLen = fs.Read(buff, 0, buffLength) End While ' Close the file stream and the Request Stream strm.Close() fs.Close() 'Catch ex As Exception 'MsgBox(ex.Message, "Upload Error") 'End Try Where all the stars are is where the error occurs. The error message is this: (421) Service not available, closing control connection. Does anyone have any ideas? I was thinking it was something to do with no port declaration but I'm try to find out how to declare one to see if that fixes the problem.

    Visual Basic help sysadmin tutorial question

  • File Transferring
    M Michael101

    Hi people, Does anyone know how to transfer files from one computer to another (not on the same network). I understand that in VB.NET you have the FTP libraries incorporated in the back end, but I'm not entirely sure on how to use them. I've tried this but it doesn't work, yet! Dim uri As New Uri("file://C:\Documents and Settings\mhomsey\My Documents\Visual Studio 2005\Projects\CareerOneUploader\CareerOneUploader\bin\Debug\GENERATED_XML\Careersmehrmyc20080207.xml") Dim reader As TextReader = File.OpenText(xmlFileName) Dim xml As String = reader.ReadToEnd() If (uri.Scheme = uri.UriSchemeFile) Then Dim request As FileWebRequest = FileWebRequest.Create(uri) Dim response As FileWebRequest = request.GetResponse() Dim reader As New StreamReader(response.GetResponse()) Dim tmp As String = reader.ReadToEnd() response.close() End If The code isn't finished but I just want to be able to send a file from this computer, to another remote computer. Does anyone have the same code? Thanks very much in advance and I appreciate your help. Michael :)

    Visual Basic csharp visual-studio sysadmin debugging

  • Simple problem with a list!
    M Michael101

    Thank you very much

    C / C++ / MFC help question

  • Simple problem with a list!
    M Michael101

    Hi people, I've got an If statement in my code that needs to check the last element of a list. Like follows: if (Remainder == 1 && TesterIterator != Mersenne.end()) This doesn't work the way I would like because the .end() command takes you to one element past the end of the list :'(. I would like to construct an if statement that would like to go to the last element minus one. This is one that I tried but it didn't work :( if (Remainder == 1 && TesterIterator != (Mersenne.end()--)) Does anyone have any ideas? I am very appreciative for all your help in advance. Michael :)

    C / C++ / MFC help question

  • FTP Code
    M Michael101

    Hey Everyone, I've got a windows application and I want to know if anyone has or knows any code for FTPing files through the system. The code I've got so far is here, but I think I'm missing a class which I've failed to find. If anyone has different code that works, then that would be greatly appreciated! :-) This is what I have so far out of interest: Dim ftp As New Chilkat.Ftp2() <----- This is my error, Chilkat.FTP2() isn't defined!!! Dim success As Boolean ' Any string unlocks the component for the 1st 30-days. success = ftp.UnlockComponent("Anything for 30-day trial") If (success <> True) Then MsgBox(ftp.LastErrorText) Exit Sub End If ftp.Hostname = "ftp.chilkatsoft.com" 'What's the host name? ftp.Username = "****" 'What's the username? ftp.Password = "****" 'What's the password? 'The default data transfer mode is "Active" as opposed to "Passive". 'Connect and login to the FTP server. success = ftp.Connect() If (success <> True) Then MsgBox(ftp.LastErrorText) Exit Sub End If ' Change to the remote directory where the file will be uploaded. success = ftp.ChangeRemoteDir("junk") If (success <> True) Then MsgBox(ftp.LastErrorText) Exit Sub End If ' Upload a file. Dim localFilename As String localFilename = "hamlet.xml" 'Change that to the file I have to upload Dim remoteFilename As String remoteFilename = "hamlet.xml" 'Like wise. success = ftp.PutFile(localFilename, remoteFilename) If (success <> True) Then MsgBox(ftp.LastErrorText) Exit Sub End If ftp.Disconnect() MsgBox("File Uploaded!") Cheers, Michael :)

    Visual Basic com sysadmin xml help question

  • Need suggestion on project
    M Michael101

    Hey, Yeah you're approach is fine by all means. I don't know how you are planning to dissect the text in anyway but I presume it's not difficult or you know how to do it. Yeah save the data to a database if it's successful and then get the web page to query that table using a dataset object to just bind it to a grid. I suggest making a table for successful and unsuccessful results so if it doesn't go to the database it's not just thrown in the bin and never seen again. Cheers, Michael

    ASP.NET csharp database asp-net question

  • Huge ASP and ASP.NET Problem with old ADO.NET
    M Michael101

    Hi, I've was given an old ADO.NET websystem project. They built this project in old ASP (using recordsets such and so forth) and they want me to convert all the ASP code to ASP.NET if they won't work together. When I included some ASP pages into my new ASP.NET project I got this error. Error 1 'Let' and 'Set' assignment statements are no longer supported. C:\Documents and Settings\mhomsey\My Documents\Visual Studio 2005\WebSites\MyWebSite\dbconnection.asp 15 Does this mean, this old code doesn't work anymore and I have to rebuild that file or is there a way around this sort of error? I appreciate all your help as I hope someone out there in this world knows a quick easy solution to this problem rather than rebuilding it all. Michael - Cheers :) FYI - I'm using VS2005 and I'm trying to convert it to ASP.NET 2.0

    ASP.NET help csharp asp-net visual-studio question

  • Existing Project including problem
    M Michael101

    ummmm.... The only thing that immediately comes to mind is perhaps you haven't included the .cpp or .h files (or whatever types of files you're using) in your project. Make sure you've included the files and then you shouldn't have any other problems otherwise give me the exact error message and I'll see what I can do. Good luck and cheers mate, Michael

    C / C++ / MFC help question csharp c++ visual-studio

  • Vector Assertion Failure.
    M Michael101

    Effective STL by Meyers, yeah ok I'll buy it! Thanks for all your help, I have to leave this error for later but I'm sure I'll crack it soon. It's just finiky that's all. Thanks for all your help, I appreciate it! Michael :)

    C / C++ / MFC help graphics question

  • Vector Assertion Failure.
    M Michael101

    Ahh I found the problem... The Iterator equals the actual element in the Vector not the element number! Well I think that's the error

    C / C++ / MFC help graphics question

  • Vector Assertion Failure.
    M Michael101

    Iter is initialised at the beginning of the program like this -> register vector::iterator Iter; The -274 is the actual value of the Iterator but now that I've debugged it further I don't think that matters because on other occasions it's equal to something silly before the loop runs through again but the program doesn't fall over. Have you ever had problems with Iterators after adding in a container to your vector? I will try your sample code above because I understand it clearly and does seem to be much safer. Since this algorithm runs for long periods of time speed is important but for now I'll ignore that. Cheers for the reply, thanks for the help, Michael :)

    C / C++ / MFC help graphics question

  • Vector Assertion Failure.
    M Michael101

    My code is calculating numbers together in the vector and based on certain conditions it must build another element in the vector to keep the equation going. If not, eventually the number will be too big for longs, int, short e.t.c.... When it creates a new element it always returns to that for loop code and it the iterator is always equal to -274 which is just wrong. It should be one more to what it left off as. The code is posted below, it's a complex equation but it might help. for (Iter = PrimeNumber.begin(); Iter != PrimeNumber.end(); Iter++) { //*Iter = PrimeNumber[y]; *(Iter) += *Iter; if (*Iter > 9) { PrimeNumber[0] -= 10; for (Iter1 = PrimeNumber.begin(); Iter1 != PrimeNumber.end(); Iter1++) { Counter++; if (Counter = PrimeNumber.size() - 1) *(Iter + 1) += (*(Iter + 1)) + 1; else PrimeNumber.push_back(1); if (PrimeNumber[Counter] > 9) { if (Counter < PrimeNumber.size()) { PrimeNumber[Counter] -= 10; PrimeNumber[Counter + 1] += 1; } else PrimeNumber.push_back(1); } break; } Counter = 0; } Ultimately, this code increaments numbers into the vector and if the number is 16 in the vector is displays as [6][1] (Computers write backwards of course). It's when it makes the new element for the 1 it goes nuts on the Iterator. Thanks for your interest, I appreciate the help! Michael :)

    C / C++ / MFC help graphics question

  • Vector Assertion Failure.
    M Michael101

    Hi everyone, This is my code below, the first time I run through this code it's fine but when it hits the for loop a second time my Iter = -768 (or something like that) and it gives me an assertion error. The first time it runs through this loop it always uses the else statement (if that's a clue) not the if. for (Iter = PrimeNumber.begin(); Iter != PrimeNumber.end(); Iter++) { size++; if (size < PrimeNumber.size() -1) *(Iter + 1) += 1; else PrimeNumber.push_back(1); } Does anyone have any ideas? Thanks for the attention and help in advance, I appreciate it. Cheers, Michael :)

    C / C++ / MFC help graphics question

  • Vectors!
    M Michael101

    You Champion! :-D

    C / C++ / MFC graphics help tutorial question

  • Vectors!
    M Michael101

    Hey, I have a for loop iterating through a Vector. When my program hits certain conditions it needs to do get the value of an element and add one to it. I tried this but it didn't work: PrimeNumber(Iter + 1) += 1; It has to be the next element in the vector and it has to increment that next elements value by one! I've tried declaring an Iterator and using similar code -> *Iter + 1 += 1; but that still doesn't work :-( Does anyone have any ideas on how to modify the content of a vector? Thanks for all the help in advance I appreciate it! :) Michael

    C / C++ / MFC graphics help tutorial question

  • Array Lengths?
    M Michael101

    yep I agree.... Thank you for your help! Cheers

    C / C++ / MFC data-structures help tutorial question

  • Array Lengths?
    M Michael101

    Do you know any methods or functions that return how many elements that are in the array? Like before Array[0] = 1; Array[1] = 2; There are "Two" elements in this array. Do you know of anything like that? Cheers again, Michael

    C / C++ / MFC data-structures help tutorial question

  • Array Lengths?
    M Michael101

    register short* PrimeNumber = 0; That's how I declared the array.... I would change it if I need to though. Yeah I want allocate it more memory during runtime i.e it grows. Cheers, Michael

    C / C++ / MFC data-structures help tutorial question

  • Array Lengths?
    M Michael101

    Hey Everyone, I've got a short array that starts with 1 element (obviously) and it grows if it needs more elements. Untimately the array needs to grow as much as possible to suit the program.... I don't know however, how to return the size of the array. e.g. ShortArray[0] = 1; ShortArray[1] = 5; Length of the array is 2... Mean there are two elements. How do you return the length? Thanks for your help in advance.... I appreciate all your input :-) Cheers, Michael

    C / C++ / MFC data-structures help tutorial question
  • Login

  • Don't have an account? Register

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