grvs 17 Junior Poster in Training

Hi

I am trying to display time in a text box which updates itself every second. I am using visual C# and I am pretty new to it. (My first program in visual C#)
(Actually its part of a little bigger problem in which I have to implement a timer class, which will show me how much time has been elapsed since I have started the program. Again this elapsed time will update it every second)


I know this can be done using timer class but I don't know exactly how to use it.
I found a similar thread at DaniWeb, but I am stuck at "how to display it" and where are all the ticks thing that they talk about. Also I tried to use object browser but seems like I am unable to interpret what each thing displayed in object browser does.


So here is my code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace Timer
{
    public partial class Timer : Form
    {
        public Timer()
        {
            InitializeComponent();
        }
     
     
        private void Form1_Load(object sender, EventArgs e)
        {
            String hours;
            String minutes;
            String seconds;

            hours = DateTime.Now.Hour.ToString();
            minutes = DateTime.Now.Minute.ToString();
            seconds = DateTime.Now.Second.ToString();
            textBox1.Text = "System Time - " + hours + ":" + minutes + ":" + seconds;
            timer1.Enabled = false;
            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
        }

        private void button2_Click(object sender, EventArgs e)
        { …
grvs 17 Junior Poster in Training

wow... I dint know that... thanks...
but this "free shell account" works very fine for me...

grvs 17 Junior Poster in Training

Thanks, that helps...

grvs 17 Junior Poster in Training

Hey thanks...
I have a Putty client. But I don't if there is a UNIX server which allows random users like me to login to them and use the UNIX OS.

btw this the link you sent seems good :)

grvs 17 Junior Poster in Training

Hi

I want to learn UNIX and UNIX shell scripting. But right now I can just read the tutorials as I don't have UNIX/LINUX at my computer. Is there any way by which I can try and test my UNIX commands and scripts over internet.

What I mean to say is there any online interface where I get a shell on my browser or using something like telnet, so that I can use UNIX OS on my windows OS without actually installing it (and without using Virtual Machine kind of things).

Thanks

grvs 17 Junior Poster in Training

Ok again it seems that Hijackthis works on my computer but network doesn't allow it to send log files directly to Trend micro website. I will try MBA - M tomorrow (at home right now).

grvs 17 Junior Poster in Training

Thanks gerbil. I got some of the administrative access today, which includes regedit, command prompt, and installation of programs and I am able to download things from some of the websites. (Still no control over the symantec antivirus installed in my computer)

So i tried the to change the home page to blank (and google also) using regedit, but the virus/worm resets it to http://www.socio.fusionace.com/ (which is different from original but it redirects my IE home page to that page only)


Then I downloaded Hijack this but when I click on Analyze this, it takes me to an error page.
(Answer - Error running Hijack This)

I do have hijackthis.log (changed to .txt to upload) and startuplist.txt whose contents are as attached.

I also tried to empty my windows/temp folder but there are two files which I couldn't remove.
these are
C:\WINDOWS\Temp\QosServ.log
C:\WINDOWS\Temp\hsperfdata_SYSTEM\1612 (no extension)

Seems like I can't even read those files.

Thanks

grvs 17 Junior Poster in Training

I agree jholland, but its my office computer and I don't seem to have all the rights to perform all these actions. (Also I tried to perform online scans, checked my task manager process lists, which are part of that list) Here I am not saying I have done some of things in that list, so you should do something for me... that would be ridiculous. I was just wondering if anyone have come across this problem before so that I could take help from their experience.

grvs 17 Junior Poster in Training

Hi
My IE homepage is set to the above mentioned page and resetting it to blank doesn't work. If you think there might be some danger in visiting this page, here are the contents(top 4 lines):

This Account Has Been Suspended

Why? There could be a few reasons why your account is suspended, the most common are...


Account Unpaid?

Unpaid accounts are suspended 10 days after the due date
however re-activation is INSTANT following payment, like this...


I found something on following website about this problem, but somehow I did not trust this website.
www.securitystronghold.com/gates/darker.html

I felt like the creator of both websites might be the same. And they might try to install something bad by prompting me to download there so called darker and svchost.exe removal tool. If somebody has tested this and trust them, then I will download their tool.

Also I feel there is some virus in my computer as I found wscript.exe in my task manager.This is my office computer and I have symantec anti-virus, but I don't like it. It anyways does a force scan every morning(over which I have absolutely no control) and does not find any virus.

I also tried ESET online scan but it completed in 0.00 secs, saying no threats have been found. I think my office network doesn't allow this kind of scanning. (As Kaspersky is still trying to get my computer configuration since …

grvs 17 Junior Poster in Training

The following website explain ActionScript while creating a game...

http://www.brighthub.com/internet/web-development/articles/11010.aspx

grvs 17 Junior Poster in Training

yeah this is not related to game development but I can answer your questions...

1. Turn off your windows firewall and Anti-virus firewall. Then you should be able to join games.
2. If you don't want to turn off firewalls, then you need to add exception, and open ports.
I know how this works for XP:
Go to: Control Panel -> Windows Firewall -> Exceptions

Click on Add program, Browse for hamachi executable and add it.
similarly add age2_x1.exe as exception.

Then click on add ports and open following ports
TCP Ports
2300-2400,47624
UDP Ports
2300-2400

Now try using Hamachi or direct ip to play the games.
I have never tried GameSpy, but there is one very-2 good client to play AOE-II online. It is called IGZ (www.igzones.com) Thousands of players are always online there. You can also try www.gamepark.eu
To play at igz and gamepark, you need to install 1.0c/1.0e patch. This patch is available at many website. (site #1 and 2 below). I believe Gamespy also uses this patch as all pro use this patch to play aoe. it makes online gaming hack proof to a little more extent.

PS: when you learn some tactics of the game You can also play with me :)

For more information and help go to:

  1. www.aocgroup.com.ar
  2. www.lclan.com
  3. www.indusclan.com
  4. www.aok.heavangames.com (search this on …
grvs 17 Junior Poster in Training

Thanks guys, I got the password from ISP long time back...

Zeroth:
Last time I could change it, as I remember the old password (current password at that point of time..) u know how passwords are changed... right ?

Now if your point is good, that secure passwords should not be recoverable, but as I have heard, and started to believe, that windows itself is not that secure.... So there might be ways to recover passwords in windows.

grvs 17 Junior Poster in Training

Question is why content vanish when Midi goes back to the page where she/he writes a post. And you know its not due to advertisements.
Your point is valid, but you pointed it out in reply of a question which was about some problem either in Midi's browser or in our website.

grvs 17 Junior Poster in Training

Become a DaniWeb donator and you can get rid of those annoying ads.

I don't think that's very mature post Mr. Ancient Dragon.

@ Midi...
I don't think thats a cache problem, as in my office I can't clean cache by myself, but I never faced a problem like yours. Wait for a response from someone who might know exact cause of your problem.

grvs 17 Junior Poster in Training

My Internet Service Provider (ISP) is "BSNL India" and they don't give me option to reset password when i forget it.

Day before yesterday I changed it, and luckily clicked on the remember password option. Now I have no idea what is my new password. I can access internet by cannot login to my ISP site to keep record of my internet usage which is quite expensive for me.

So I want to know, is there a way to recover that password. Its not windows user password so I guess file might be different from what we call SAM (I came to know about it while I was searching for solution to my problem). But for sure its stored somewhere in my computer. Please help me recover it.

Many many thanks in advance.

grvs 17 Junior Poster in Training

because i need to automate things....

grvs 17 Junior Poster in Training

58 views and still no reply... I guess people here don't love easy work.
But if anyone among you have the same problem, I got a solution.

The solution is:

Public Sub ImportTextFile(Fname As String, Sep As String)

    Dim RowNdx As Long
    Dim ColNdx As Integer
    Dim TempVal As Variant
    Dim WholeLine As String
    Dim Pos As Integer
    Dim NextPos As Integer
    Dim SaveColNdx As Integer
    
    Application.ScreenUpdating = False
    'On Error GoTo EndMacro:
    
    SaveColNdx = ActiveCell.Column
    RowNdx = ActiveCell.Row
    
    Open Fname For Input Access Read As #1
    
    While Not EOF(1)
        Line Input #1, WholeLine
        If Right(WholeLine, 1) <> Sep Then
            WholeLine = WholeLine & Sep
        End If
        ColNdx = SaveColNdx
        Pos = 1
        NextPos = InStr(Pos, WholeLine, Sep)
        While NextPos >= 1
            TempVal = Mid(WholeLine, Pos, NextPos - Pos)
            Cells(RowNdx, ColNdx).Value = TempVal
            Pos = NextPos + 1
            ColNdx = ColNdx + 1
            NextPos = InStr(Pos, WholeLine, Sep)
        Wend
        RowNdx = RowNdx + 1
    Wend
End Sub

Then use this subroutine into importData after you get a file name and a separator.
But now I am stuck at "how to make graph in PowerPoint using data in excel?".
Any suggestions (though I haven't searched a lot on this, I hope to find a solution my self, will compare to yours if I find it myself)

grvs 17 Junior Poster in Training

Hello guys

I am a newbie so please don't freak if you find this question stupid or easy

I have some data in CSV format, which I want to bring into Excel, and based on that data, I have to create graphs in PowerPoint.
I searched on Google and everywhere I find complex techniques to bring data into data-bases using some ADO objects and something called RECORDSET.
I want to know if there is something simpler which brings data into excel only.

Here is the Code till now.

sub importData()
fileName = Application.GetOpenFilename("Text Files (*.csv),*.csv", , "Please selec text file (in .csv format)...")
If fileName = "False" Then Exit Sub  [I]'User pressed Cancel on the open file dialog[/I]
End Sub

Next steps
save data from this file ( fileName ) in excel
create graph in PowerPoint.

Please provide guidance
Thanks
Gaurav

grvs 17 Junior Poster in Training

Thanks PhilliePhan

actually anything in safe mode woudn't run.
I saw that rundll32.exe and found that its icon is not like an exe file but some other which i don't know... (similar to text files in vista)
i deleted it from there n dllcache too. Downloaded new rundll32.exe from web and windows din't let me copy... (how come virus could modify it)

and so on... i kept on trying on lost my internet too....
finally i had to reinstall windows... so i can't tell you how your tool would work. but i have downloaded it for the bad times in future.

Thanks once again.

grvs 17 Junior Poster in Training

Hello guys

I gone through "read me first" for this section and seems that I can't do anything.
Here is the problem and the things I tried to solve my problem.

The first encounter with the virus was when I tried to start gtalk (4-5 days ago), and a window poped up saying 'select the program you want to use to open this file' (you all must be familiar with this msg, it comes when we try to open something windows doesn't recognize).

I inquired and got to know that my cousin brought some files from some internet cafe which
caused the problem. I still don't know what files he brought. I looked for suspicious looking programs and files so I found some unusual things some of which i remember.

  1. driveguard.exe running in task manager
  2. a folder named driveguard in "C:/Program Files" containing driveguard.exe and a text file which i deleted instantly. so no information on them too
  3. I also felt a process wuauclt.exe which is still running in my task manager (it re-initialize it by itself when i stop/end it) is also a virus (i am a newbie)
  4. and some other process which i don't remember, I stopped (ended) them.

Then i tried opening gtalk again and same msg. similarly with other programs. I downloaded an open source antivirus from www.clamwin.com and found that i can't even install anything.

I tried gtalk (and other programs) by right clicking …

grvs 17 Junior Poster in Training

and to you all, I updated my profile, will be fun reading it...

enjoy

grvs 17 Junior Poster in Training

thanks happy geek

grvs 17 Junior Poster in Training

Hi Gaurav:
Welcome to the forum!

Thank you very much
Self help books..... are you selling those things ??

grvs 17 Junior Poster in Training

Glad to have you here!

thank you zandiago.... nice location -home :D

grvs 17 Junior Poster in Training

If I am getting you the right way, I don't think thats the case with many of us MIdi, and soon you too will be out of this trouble, as if u want to navigate to other objects, just do it before posting, (is there any difficulties in that?... u can save ur post at ur computer also)

But I still want editing allowed after 30 mins, may be not always but in some cases. Like in threads like Introduction etc.
eg. your interest might changes after sometime, or you just learned something you want people to know, or you want to correct something (as it was the case with me, mods did that for me, but not exactly in the way I wanted, and now I don't want to give them trouble again) so.... I guess, if its not very difficult to allow editing some posts forever, while keeping the 30 mins rule with all other posts, it should be done.

grvs 17 Junior Poster in Training

hi lajocar.... thats jin kazama.. my fav. character too... :)

grvs 17 Junior Poster in Training

right dude.... anyways... I will try a suggestion in feedback forum....

grvs 17 Junior Poster in Training

Thank you peter for removing url, and jasimp for giving me correct info about editing post, which I also got from feedback forum.

Nice to see that people like you replied to my post :)

grvs 17 Junior Poster in Training
int * readArray(int size){  
    // free(A); this when uncommented cause the first element to be zero, makes sense, but       
    // why other values are not lost
    return A; // Here i return the pointer. /* What are you returning here if you freed it before? */
}

well that was one of my question. Why other elements of array are displayed correctly? So may be I'll try to figure it out.

You want to free memory when you don't need it anymore. So, thinking this logically, you want to return a pointer of that memory to the calling function in main. If you freed that memory you are passing a pointer to some unpredictable piece of memory.
When you free some memory using function free(), it doesn't mean that memory automatically is zeroed out, it means now that memory is available for new use.
In essence your function may or may not return the right value, you left it to chance, since it could have been altered already.

May be here are hints for my answer. but If I had left it to chance then, why every time other elements are correctly displayed?

[edit:] I leave for you to figure where then you need to use free()

Well while i was trying to figure out, Salem solved it for me, and you explained, I couldn't stop the temptation to read Salem's and then your post... :-/ so now I can just say thank you both a lot.

grvs 17 Junior Poster in Training

I allocated memory to a pointer, which i had to return. So I don't know where to free it as its a local variable. I was trying to create an array of variable length (user-specified). I got some help for that in this forum only under this thread

here is the code

#include <stdio.h>

void printArray(int arr [], int size);
int * readArray(int size);

int main(){    
    int size;
    printf("Enter the size of the array ");
    scanf("%d",&size);    
    printArray(readArray(size),size);
    getchar();    
    return 0;
}

int * readArray(int size){
    int *A = malloc ( size * sizeof *A );    
    int i;
    for (i=0;i<size;i++){
        printf("\nEnter the element no. %d: ",i+1);
        scanf("%d",(A+i));
    }
    // free(A); this when uncommented cause the first element to be zero, makes sense, but       
    // why other values are not lost
    return A; // Here i return the pointer.
}

void printArray(int *arr, int size){
     int i=0;
     for (i=0; i<size;i++){
         printf("%d  ", *(arr++));
     }
     printf("\n");
     getchar();
}

Should I free it before returning it? If yes then how? Or should I free it in main, will it be known there ?

A sample Output of the program when I free pointer A before returning it is uploaded in image.