Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1351.

Solve : Printer.Orientatio Method in VB6?

Answer»

Hi everyone, I NEED to use the Printer.Orientation method using the vbPRORLandscape value (2), but I obtain a RUNTIME error nº 380.

I'm running my application in Windows XP. I have been read that exist some INCOMPATIBLE issue between XP and this API but I haven't found anything.

Best Regards

1352.

Solve : Outputting to a txt file - VB?

Answer»

VB Express 2005

How do I create a text file and then output variables to it? I found an example but it will only create the text file and the rest won't work. I don;t know where that code went to anyway.One way would be to use a StreamWriter object:

Code: [Select]Using SW As StreamWriter = New StreamWriter("c:\temp\TestFile.txt")
sw.Writeline("This is line 1")
sw.Writeline("This is line 2")
sw.Writeline("This is line 3")
sw.Writeline("This is line 4")
sw.WriteLine(DateTime.Now)
sw.close()
End Using

For my own information, do the Express versions COME with Help?

Good LUCK.
yes. I try it but the examples don't ALWAYS work for me. actually they rarely work properly.

thank you.LOL. I don't know all the errors in VB bu it says type 'streamwriter' is not defined.Sorry for the confusion. You also need to add these two lines your declaration section:

Code: [Select]Imports System
Imports System.IO

The examples don't always work for me either.
Thank you, thank you, thank you. lol

1353.

Solve : SkinCrafter- VB 2008?

Answer»

Has anyone here used SkinCrafter with VB.NET 2008 before? I have the DEMO version and wanted to see how it works. You would think the actual site would be of any help, but alas it is not. So I turn to my only hope, which is here. Anyway, how do I go about implementing SkinCrafter into the Toolbox components. I'm using Visual Studio 2008. Any help would be great.Quote

You would think the actual site would be of any help, but alas it is not

Adding Skincrafter to the toolbox is a function of Visual Studio not Skincrafter.

In VS click Tools==>Choose Toolbox Items

Checkout the .Net tab if you installed the .Net version or the COM tab if you installed the ActiveX. If found make sure it's checked. If not found, use the browse button to locate the item.

Good luck.

There are two compiled help files on the Skincrafter site. Did you download the ONE applicable to your version?Actually I got the blasted THING to work about 20 min after I posted the original message. I dont give up that easy and not getting things to work really angers me. The problem was with the instructions I was finding on the net. They were either for older versions of VS or they kept telling me to use the COM tab. I finally decided to check out the .Net tab like you specified Sidewinder. It worked like a charm. At any rate thanks for the quick reply.
1354.

Solve : Visual Studio.NET 2005?

Answer»

Quote

During installing Disc 1 that you suggested, this is what was installed:

Microsoft Visual Studio 2005 64bit Prerequisites (x64)
Microsoft Document Explorer 2005
Microsoft Visual Studio 2005
.NET Compact Framework 1.0 SP3
.NET Compact Framework 2.0
Microsoft Visual J# 2.0 Redistributable Package
SQL Server 2005 Mobile Edition
Microsoft Device Emulator Version 1.0
Microsoft SQL Server 2005 Express Edition x64
Microsoft Visual Studio 2005 Remote Dubugger (x64)
Microsoft .NET Framework 2.0 SDK (x64)

Your installation looks incomplete. Seems to be missing the program languages, VB, C#, C++, and the Web Developer.

Quote
So it wanted me to go online and install 2 things, which is Visual Studio 2005 Service Pack 1 and Visual Studio 2005 Service Pack 1 Update for Windows Vista....

A trip to Windows Update is in order. From a security standpoint, you need to keep your machine current. Then try installing disc 2 again.

If Disc 2 installs SUCCESSFULLY, next up would be SQL:

1. SQL Server 2005 Developer Edition 64-bit CD1
2. SQL Server 2005 Developer Edition 64-bit CD2

I'm a bit surprised with the Microsoft SQL Server 2005 Express Edition x64 installation. This may or may not create a problem with the SQL Server install. If it does you may have to uninstall the SQL Express edition before the SQL Developer install.

If you installed VS into the default path, do the same with SQL. The products are tightly integrated and your machine will know where to find the COMPONENTS when needed.

As for the MSDN library, best I can guess is choose one of the CD's marked MSDN Disc 1 and go from there.

Quote
Now do you think I'll ever need SQL or the MSDN for this program at all? I mean what are the purposes of those? If you don't mind me asking.

SQL Server is a Microsoft database product. If this class is to learn programming, it seems reasonable you'll learn database programming and perhaps a bit of DB administration.

The MSDN library discs are the help files. Not only only do they offer specific help for the programming languages, but they can teach you programming techniques and offer many examples you can use directly in your code. Do not leave home without them.

FYI: The academic version of VS is the same as the Professional edition with a different license and a way cheaper price. If you need help, any info for the Pro version will apply to you.

Good luck.

Quote
A trip to Windows Update is in order. From a security standpoint, you need to keep your machine current. Then try installing disc 2 again.

Okay, now last night I ended up seeing that I needed up update for windows for the COMPUTER. So I did that, but tried to run the program and it still said compatibility issues were still there. So I'm not sure.

Now how do I go about reinstalling what's on disc 2 when it's a continue disc from disc 1... Does this mean I would have to possibly uninstall and reinstall? Because when I put in disc 2, and then go to my computer and double click on the disc icon, it doesn't do anything. So is there some thing I need to do in order to get disc to install it's content on my computer?

Thanks again.Most Microsoft applications make a restore point before installing the product. Your best bet would be to restore the system to before the VS install. If you did the Windows Update after the VS install, you'll have to re-do the Windows Updates. That would be the cleanest solution.

If there is no restore point, you'll need to do it manually:

Quote
Remove Visual Studio 2005 by using Add or Remove Programs
1.In Control Panel, click Add or Remove Programs.

Note To manually open this Control Panel item, click Start, click Run, type appwiz.cpl in Open box, and then click OK.
2.In the Currently installed programs list, click Microsoft Visual Studio 2005, and then click Change/Remove. Follow the on-screen instructions to remove Microsoft Visual Studio 2005.
3.Note This step is optional. You do not have to remove this component. Additionally, this component might not have been included in the original installation of Visual Studio 2005.

Remove Visual Studio 2005 from the Microsoft Windows Installer cache. To do this, follow these steps:
a. Click Start, click Run, type installer in the Open box, and then click OK.
b. On the View menu in Windows Installer, click Details.
c. Right-click the Name column header, and then click Comments.
d. Right-click the cached Windows Installer file that has the Microsoft Visual Studio Tools for Office System 2005 Runtime RTL X86 enu comment, and then click Uninstall.
e. Follow the on-screen instructions to uninstall this package.
Source: Remove Visual Studio 2005

Just out of curiosity, what course are you taking?

I'm going for my Associates degree in Web Design. The name of the course is Visual Basic.

Now I haven't done the steps provided above. LOL But I'll see what I can do. I'll edit this post when I do the following, and let you know what happens.

Update1: I went in to remove visual studio program and there's like a lot to remove... Do I want to uninstall all of it, or just the program visual studio?

The reason I'm asking is because there are several things installed since I installed Visual Studio that ties into that program.

Update 2: I think I figured out how to remove it... I guess we'll see. LOL And it seems like it may take a while to remove, ha.Okay, uninstall has been done. This is what it says:

Next Step: Uninstall additional components

Additional components might have been installed on your computer by Visual Studio during setup. These components must be manually uninstalled using Add or Remove Programs in the order listed below.

Note: Uninstalling these components might affect other applications you have installed that rely on these components.

The following components might have been installed with Visual Studio:

Microsoft MSDN 2005 Express Edition
Microsoft Visual Studio 2005 Tools for Office Runtime Language Pack
Microsoft Visual Studio 2005 Tools for Office Runtime
Microsoft Device Emulator version 1.0
Microsoft .NET Compact Framework 1.0
Microsoft .NET Compact Framework 2.0
Microsoft SQL Mobile 2005 Development Tools
Microsoft Visual J# 2.0 Redistributable Package
Microsoft Visual J# 2.0 Redistributable Language Pack
Microsoft Document Explorer 2005
Microsoft Document Explorer 2005 Language Pack
Microsoft Data Access Components 2.8 SP1 (Windows 2000 only)
Microsoft Visual Studio 2005 64bit Prerequisites
Microsoft .NET Framework 2.0 SDK (x64)
Microsoft Visual Studio 2005 Remote Debugger (x64)
Microsoft Visual Studio 2005 Remote Debugger Light (x64)

The following components might have been installed with SQL Server Express, and need to be removed in the order listed below:
Note: Uninstall of the SQL Express instances will leave behind the user-created databases, which can then be re-attached to the new instance.

Microsoft SQL Server 2005 Express CTP
Microsoft SQL Server 2005 Express Tools CTP
Microsoft SQL Server Setup Support Files
Microsoft SQL Native Client
The following components must be uninstalled last:


MSXML 6.0 Parser and SDK (only on 32bit)
MSXML 6.0 Parser and SDK x64 (Only on 64bit)
Microsoft .NET Framework 2.0 Language Pack
Microsoft .NET Framework 2.0

So what's the next step? LOL

Update: I did all of what was asked above. Now do I want to see if there are any required updates for windows?Quote
I did all of what was asked above. Now do I want to see if there are any required updates for windows?

I'm guessing you didn't use a restore point, that you manually removed the VS installation, so logically the Windows updates are still on your system. You can always visit the update site before you start the VS install and check if any updates are required for your system.

Going forward, try installing Disc 1 & 2
If that's successful, install SQL Server.

MSDN CD's could be duplicates. If you can, explore the discs, noting the files on each or any indication if there is such a thing as x32 & x64 bit help files.

I gotta log off right now. There is an approaching thunderstorm.

Later,

I ended up manually removing Visual Studio and then afterwards restored the computer back to a point... Why, not a clue. LOL But I did both... LOL

Now I'm updating things since they are out of date as far as my virus scanner goes and windows.

Then I will do what you asked, and will update progress in this post.

Update 1: I updated neccessary stuff, as far as windows go. I even checked to see to make sure it got all updates. It has all updates downloaded and restarted computer and what not.

Now I wasn't sure if I was supposed to install or try to install the updates that it says I need for the Visual Studio program. The Visual Studio 2005 Service Pack 1 and Visual Studio 2005 Service Pack 1 for Vista Windows.

Now it still gives me errors to do those just as it did before I removed Visual Studio... Keep in mind I haven't installed anything of Visual Studio yet. But this is the errors that pops up with trying to install the updates required for Visual Studio...

Visual Studio Sp1 : C:\Users\Bond\Desktop\VS80sp1-KB026601-X86-ENU.exe is not a valid Win32 application.

Visual Studio sp1 for Vista Windows: Windows Installer: The upgrade patch cannot be installed by the Windows Installer service because the program to be upgraded may be missing, or the upgrade patch may update a different version of the program. Verify that the program to be upgraded exists on your computer and that you have the correct upgrade patch.

So now I'm going to go ahead and reinstall Visual Studio, keeping fingers crossed that it works and doesn't do what it did before. Otherwise, I don't know what I am going to do. lolGood god! lol Well come to find out, there was no reason for me to do the uninstalling or restore point at all. It was Microsoft's fault.. HA HA, well not theirs but their server or whatever that holds the update files to download from. What was happening was the fact that the files I was saving to my computer were incomplete file downloads. So when I was trying to run the updates, it was giving me errors because of the fact that it wasn't a complete file. lol Like Visual Studio 2005 Service Pack 1 is 431 MB file size, and after I noticed the size of the file that I had downloaded, it was like 101 MB. Which wasn't the whole file. I worked on this darn thing all day, lol I couldn't get the file to completely download to my computer. Then my boyfriend's brother decided to try it on the spare computer, to download the update and it worked. Why it wouldn't install on my computer is beyond me. But I'm just glad it worked. I got all three updates that were needed to run Visual Studio 2005.

Now that all this was finally done, I went ahead and did the SQL Server 64-bit like you told me. That was a bit confusing, it asked me a lot of questions so I hope I did it correctly with me not really knowing what to select and what I didn't need and what not. lol But I did it.

Anything else you think I should do at all? Let me know, and by the way thank you so much for helping me. I appreciate it big time!!! I hope the storm didn't hit you too hard.

Update: When the first disc finished doing everything, it never asked me to put in disc 2, so I took out disc 1 and went ahead and put in disc 2. I ran it, and a box popped up that was similiar to disc 1 and it just had the following:

Prepare: Review hardware and software requirements, read the release notes

Install: tools, books online, and samples only - Run the SQL Native Client Installation Wizard

Other Information: Browse this CD, Visit the SQL Server website, read the SQL server license agreement

Now when I went ahead and clicked on Run the SQL Native Client Install wizard it popped up a box with the following:

Welcome to the Microsoft SQL Server client setup

Setup helps you install, modify or remove

Options: Next, Cancel (I clicked on next)

Next Screen:

Modify - Allows users to change the way features are installed
Repair - Repair installation errors in the program. This option fixes missing or corrupt files, shortcuts, and registry entries.
Remove - Remove microsoft SQL server native client from your computer.

Options: back, next, cancel (I clicked on next)

next screen:

Feature Selection
Select the program feaures you want installed
click an icon in the following list to change how a feature is installed
Client Components
SQL Server native Client SDK

(Now I frozed here...) Because I am not sure what I want to do. I figured maybe you could help me out with that? Possibly you and I could get on a messenger for a temporary chat session, just so I am installing or doing what I am supposed to do since I've never installed this stuff before or don't even understand. Heck don't even know if I installed the first disc right. lol

Anyways, please let me know.

Again thanks for all your help!Quote
Heck don't even know if I installed the first disc right

You probably did. I only remember being prompted for the install directory and the product key.

Quote
Now how do I go about reinstalling what's on disc 2 when it's a continue disc from disc 1...

Quote
When the first disc finished doing everything, it never asked me to put in disc 2, so I took out disc 1 and went ahead and put in disc 2.

I was under the impression that during the first install, you were prompted for Disc 2 and that's when it all fell apart. Disc 2 apparently contains SQL Express:

Quote
View Error Log
[08/15/08,21:08:01] Microsoft SQL Server 2005 Express Edition x64: [2] Error code 1 for this component means "Incorrect function.
"
[08/15/08,21:08:01] Microsoft SQL Server 2005 Express Edition x64: [2] Component Microsoft SQL Server 2005 Express Edition x64 returned an unexpected value.
[08/15/08,21:08:01] Microsoft SQL Server 2005 Express Edition x64: [2] Return from system messaging: Incorrect function.

***EndOfSession***

The SQL Developer and SQL Express are two different products. They should be able to live side by side just not in the same directory.

Quote
Feature Selection
Select the program feaures you want installed
click an icon in the following list to change how a feature is installed
Client Components
SQL Server native Client SDK

This appears to be the client side (local machine) of SQL. Try following the directions by clicking an icon. At least you'll see how the feature will be installed. For now just take the defaults, based on all the prompts and windows you're getting, should be a piece of cake to change things later.

A couple of things you can check. Open VS, click help, click about, click Copy Info. You can then paste that info in a post.

Open VS, click file, click projects. When the New Project window opens, you should see Visual Basic, C#, J#, C++ in the Project Types box. You may have to open the plus signs to see all of them.

If everything checks out, the MSDN library is next. Still no clue how you're going to distinguish between the two sets of CD's.

Good thing you got an early start on this. Quote
This appears to be the client side (local machine) of SQL. Try following the directions by clicking an icon. At least you'll see how the feature will be installed. For now just take the defaults, based on all the prompts and windows you're getting, should be a piece of cake to change things later.

I ended up doing as you said, and a error happened to pop up which said:
Microsoft SQL Server Native Client Setup-
A network error occurred while attempting to read from the file: E:\Setup\sqlncli_x64.msi

Not sure what is happening? Any suggestions on this part?

Now while I'm waiting for this to be fixed, lol I'll go ahead and do what you suggested and get that posted as well... I'll update it in here.

Microsoft Visual Studio 2005
Version 8.0.50727.867 (vsvista.050727-8600)
Microsoft .NET Framework
Version 2.0.50727 SP1

Installed Edition: Professional

Microsoft Visual Basic 2005 77626-235-9250471-41401
Microsoft Visual Basic 2005

Microsoft Visual C# 2005 77626-235-9250471-41401
Microsoft Visual C# 2005

Microsoft Visual C++ 2005 77626-235-9250471-41401
Microsoft Visual C++ 2005

Microsoft Visual J# 2005 77626-235-9250471-41401
Microsoft Visual J# 2005

Microsoft Visual Web Developer 2005 77626-235-9250471-41401
Microsoft Visual Web Developer 2005

Microsoft Web Application Projects 2005 77626-235-9250471-41401
Microsoft Web Application Projects 2005
Version 8.0.50727.867

Crystal Reports AAC60-G0CSA4B-V7000AY
Crystal Reports for Visual Studio 2005


Microsoft Visual Studio 2005 Professional Edition - ENU Service Pack 1 (KB926601)
This service pack is for Microsoft Visual Studio 2005 Professional Edition - ENU.
If you later install a more recent service pack, this service pack will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/926601

Update for Microsoft Visual Studio 2005 Professional Edition - ENU (KB932232)
This Update is for Microsoft Visual Studio 2005 Professional Edition - ENU.
If you later install a more recent service pack, this Update will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/932232

And when I do the new project, those languages do show up and Visual basic as well. Must be doing some thing right, finally!Looking good. I may have lead you down the wrong path however on the SQL server.

Quote
I went ahead and did the SQL Server 64-bit

Research is giving me mixed signals:

Quote
Finally i solved the problem following the next steps:

1. Uninstall native client using add/remove programs on control panel.
2.Try to install SQL Server Again.

I tried al least 3 times but at the end it works.

Thank you for the support.

About the other solutions none worked
Source: Soution 1

Quote
The "Installing Prerequisites" stage of the installer installs the incorrect version of the SQL Native Client. Immediately after the "Installing Prerequisites" stage (but before the rest of the installation process), follow any of the above advice to download/extract the sqlncli_x64.msi file, go to the control panel and remove the "Microsoft SQL Native Client", and then install the newly downloaded/extracted msi instead. When that's done, you should be able to go through the end of the installtion process without too much more difficulty.
Source: Solution 2

The disk may have a bad version of sqlncli_x64.msi. You can download a version from here
Solution 2 seems to be the more reasonable approach.

The bottom line is Microsoft SQL Server Native Client must be installed ahead of SQL Server. If you have SQL Server installed, use add/remove programs to get rid of it and use the downloaded sqlncli_x64.msi to continue.

Quote
Crystal Reports AAC60-G0CSA4B-V7000AY
Crystal Reports for Visual Studio 2005

My Standard Edition didn't come with Crystal Reports. I'd be really jealous, but it was a free copy for attending their launch party.

Can't wait till we get to those help files!Okay, I did the following that you had told me to do. I did the simple solution 2 strategy. lol

Now am I supposed to try and run the 2nd SQL disc now? The reason I'm asking is because when I tried putting in the disc it had said that it couldn't run because there is a higher version of it on and that it would need to be uninstalled before it can go through the install process, or at least around that saying. LOL

Now what help files are you talking about? Ha ha!Did you check the add/remove program applet? Was SQL Server installed? Did you have to remove it? Did you download and install a new sqlncli_x64.msi? Does the SQL Native client show as installed in add/remove programs? Please be more precise when posting what you have done.

If the SQL Native client is installed, then you should be done with the CD's labeled disc 1 & 2.

Now try, starting with SQL Server 2005 Developer Edition 64-bit CD1, installing SQL Server. Please document any error messages that appear.

Quote
Now what help files are you talking about? Ha ha!
Maybe we should have installed the help first, sure could use some right now.

Quote
Did you check the add/remove program applet? Was SQL Server installed? Did you have to remove it? Did you download and install a new sqlncli_x64.msi? Does the SQL Native client show as installed in add/remove programs? Please be more precise when posting what you have done.

Sorry about that, I'm just getting a LITTLE frustrated because if it's not one thing it's another with this program ha ha. I'm just glad your taking the time to help me out with this, I really am.

I did check the add/remove program, and it was there and I went ahead and removed SQL Server because it was installed. Then I went ahead and installed the pack that you had provided and it does show up in the add/remove programs list.

Now I'll start with SQL Server 2005 disc 1 and 2. I'll update here if I happen to get errors during this task.

Update 1: Error... If I understand correctly, you wanted me to remove the previous version of SQL server, and then install the new sqlncli_x64.msi, and then pop in SQL Server 2005 Developer 1. When I did that this error popped up:

Installation of Microsoft SQL Server Native Client failed because a higher version already exists on the machine. To proceed, uninstall the higher version and then run Microsoft SQL Server Native Client Setup again.Quote
If I understand correctly, you wanted me to remove the previous version of SQL server, and then install the new sqlncli_x64.msi, and then pop in SQL Server 2005 Developer 1

That is correct, but when I read this, I get the impression that the SQL Native Client is part of the feature pack for SQL Server. To me this would require SQL Server be installed first.

See what I mean about mixed signals, some of them coming from Microsoft themselves.

Have we you tried that sequence yet? Make sure both SQL Server and SQL Native Client are not installed, then install SQL Server 1 & 2. Let's see what happens. If it does install, make note of the version level. SQL Server has SP2 available which may account for the higher version error you got.

Only 33 days till Sep 20th. With any luck we'll be done by then.
1355.

Solve : NetBeans IDE 6.1 shows incorrect package??

Answer»

Iam using NetBeans IDE 6.1 using jfreecharts to GENERATE TIME series, but it shows Incorrect Package at : package org.jfree.chart.demo;

I included all the jars and including this package tht is in the jfreechart RC1 folder. still give that when hover. Also not getin the out coz of it. Where n how to add and what to do?

1356.

Solve : Connection to the Internet?

Answer»

Is there anyway to get internet connect after the you REBOOT the computer without the REINSTALLIN disc cause my school library computer does not have the internet connectionQuote

Is there anyway to get internet connect after the you reboot the computer without the reinstallin disc

I'd SUGGEST you download it, but wait, you have no internet connection. Apparently the school librarian KNOWS the students well and has taken PRECAUTIONS to protect the students from themselves and the school from liability.

You'll probably have more luck at a public library.

1357.

Solve : How to use arrays in this??

Answer»

In place of the series, how to use arrays? And ChartPanel if possible.

import org.jfree.chart.*;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.category.DefaultCategory Dataset;
import org.jfree.data.general.DefaultPieDatase t;
import org.jfree.data.xy.*;
import org.jfree.data.*;

PUBLIC class xyLine{
public STATIC VOID main(String ARG[]){
XYSeries series = new XYSeries("Average WEIGHT");
series.add(20.0, 20.0);
series.add(40.0, 25.0);
series.add(55.0, 50.0);
series.add(70.0, 65.0);
XYDataset xyDataset = new XYSeriesCollection(series);
JFreeChart chart = ChartFactory.createXYLineChart
("XYLine Chart using JFreeChart", "Age", "Weight",
xyDataset, PlotOrientation.VERTICAL, true, true, false);
ChartFrame frame1=new ChartFrame("XYLine Chart",chart);
frame1.setVisible(true);
frame1.setSize(300,300);
}
}

1358.

Solve : how to make 2 reverse triangles??

Answer»

Ummm im trying to LEARN c++ but im stuck on a problem. how can i make a triangle look like this

* *
** **
*** ***
**** ****
***** *****
************
***** *****
**** ****
*** ***
** **
* *

using loops in c++? I've been trying to do it but i cant SEEM to get it. So help would be greatly appreciated. Like this? (This is what you typed, shown in monospaced font) There are actually 4 triangles in that figure.

Code: [Select]* *
** **
*** ***
**** ****
***** *****
************
***** *****
**** ****
*** ***
** **
* *
I am guessing not. You have not described the problem very precisely. Is it homework?

The continuous line in the middle has 12 asterisks so I will assume your pattern is meant to be 12 characters wide, and that you need to successively show 11 lines of text that consist of:

a number A of asterisks - a number S of spaces - the same number A of asterisks

If the display is 12 chars wide and you assume 1 character step in size

Then A - S - A will be:

1 asterisk 10 spaces 1 asterisk
2 asterisks 8 spaces 2 asterisks
3 asterisks 6 spaces 3 asterisks
4 asterisks 8 spaces 4 asterisks
5 asterisks 2 spaces 5 asterisks
6 asterisks 0 spaces 6 asterisks
5 asterisks 2 spaces 5 asterisks
4 asterisks 8 spaces 4 asterisks
3 asterisks 6 spaces 3 asterisks
2 asterisks 8 spaces 2 asterisks
1 asterisk 10 spaces 1 asterisk

Now all you have to do is think of an algorithm to generate that sequence of numbers or rather such a sequence for any given width of pattern. Study the figures and you will see a pattern. Then use writeln to do the lines.

the figure basically looks like the head of an axe. Two triangles point to point. it looks weird and i apologize for that. i know the code for it is suppose to be relativly short, so my 2 page long code DOESNT seem right.Pseudocode:

produce square figure (equal height & width)

H=height
W=width
W=H
for n=1 to (H/2) step 1 (
print n stars, print W - (2*n) spaces, print n stars
)

for n=( (H/2)-1) to 1 step -1 (
print n stars, print W - (2*n) spaces, print n stars
)
thank you, ill try to figure it out from here. My math cant be THAT bad.this is what i have


Code: [Select]#include <stdio.h>
#include <iostream>
#include <math.h>
#include <stdlib.h>
#include <windows.h>
#include <assert.h>
#include <ctype.h>
#include <float.h>
#include <limits.h>
#include <string.h>
#include <iostream.h>

void main(void)
{
int i;
int asterick1 = 0;
int asterick2 = 0;
int acounter1 = 1;
int acounter2 = 1;
int iscounter = i - 2;
int scounter = 0;
int spaces = i - 2;
int middlecounter = 0;
int middlecounter2 = 0;
int x = acounter1 + acounter2;

cout << "Please enter an INTEGER" << endl;
cin >> i;
cout << "*";

while ( x < i)
{
while (asterick1 <= acounter1)
{
cout << "*";
asterick1 = asterick1 + 1;
}
while (scounter <= spaces)
{
cout << " ";
scounter = scounter + 1;
}
while (asterick2 <= acounter2)
{
cout << "*";
asterick2 = asterick2 + 1;
}

acounter1 = acounter1 + 1;
acounter2 = acounter2 + 1;
spaces = spaces - 2;
cout<< endl;
}


while (middlecounter2 <= 2)
{
while (middlecounter <= i)
{
cout << "*";
}
cout << endl;
}
system ("PAUSE");
return 0;
}[/glow]

and it doesnt work.I am stuck on a similar problem. The outcome has to look like this. Can someone please help!
* ********** ********** *
** ********* ********* **
*** ******** ******** ***
**** ******* ******* ****
***** ****** ****** *****
****** ***** ***** ******
******* **** **** *******
******** *** *** ********
********* ** ** *********
********** * * **********use the methods described above, extending your solution to four triangles instead of 2.

Seriously- we aren't here to DO the homework for you, we're here to help- and I think all the information you need was provided in previously posted answers.

WE? I appreciate the help that I got from the previous posts. I was just looking for somewhere to start from.

1359.

Solve : MSN "Nudge" Like effect VB?

Answer»

Is there any PIECE of code I can add to a command button that CAUSES an EFFECT like the "Nudge" in MSN Messenger. I the code can be either Visual Basic 6 or Visual Basic.Net.

Any help would be appreciated!!!

Thanks in advance,
Cameron Grayusing the MOVE method of the form one can change the location of the window very quickly. For example, in the command button store the current Left and Top properties, then BEGIN a loop that uses the Move method, the stored values and random numbers to shake the window.

1360.

Solve : Delete current records which is displaying in the objects?

Answer»

Dear Sir

I want to records which is displaying in DIFFERENT objects. I have used below code, but doesn't work properly.

Private Sub cmddelete_Click()
Dim i As Integer
i = MsgBox("REALLY want to delete?", vbYesNo, "Delete OPTION")
If i = vbOK Then
rst.Delete adAffectCurrent
End If
End Sub

Please COME back at your earliest.

Regards
talorababu

1361.

Solve : Display all records one by one by using rst.movenext?

Answer»

Dear Sir

I have used below coding to display specific record from the database.
The problem is, when I click on command BUTTON, it is displaying only one record from the database. Though there are other records. I have tried a lot, please see my coding in below:

Dim rst As New ADODB.Recordset

Private Sub cmdshow_Click()
frmpurchaseqty.Visible = False
SSTab1.Visible = True
DBconnect
If rst.State = adStateOpen Then rst.Close
rst.Open "tblpurchasesupplyqty", CNT, adOpenDynamic, adLockOptimistic
If Not rst.EOF Then rst.MoveNext
If cmbsupplier.Text = rst.Fields(5) And cmbitemref.Text = rst.Fields(6) And DTPicker1.Value = rst.Fields(3) Then
With rst
frmpurchaseqty.cmbitem.Text = .Fields(0)
frmpurchaseqty.cmbbrand.Text = .Fields(1)
frmpurchaseqty.cmbpurchaseqty.Text = .Fields(2)
frmpurchaseqty.purchasedt.Value = .Fields(3)
frmpurchaseqty.cmbpurchaseqty.Text = .Fields(4)
frmpurchaseqty.cmbsuppliername.Text = .Fields(5)
frmpurchaseqty.cmbitemrefno.Text = .Fields(6)
frmpurchaseqty.cmbsupplierrefno.Text = .Fields(7)
'chkwarrenty.Value = .Fields(
frmpurchaseqty.cmdwrrenty.Caption = .Fields(
frmpurchaseqty.warrentyvoiddt.Value = .Fields(9)
End With
End If
End Sub
assuming you have successfully create the connection and rst object.
to iterate the recordset, pseudocode as below:

Code: [Select]while not rst.eof
msgbox rst.field(0)
rst.movenext
wendDear Sir

Thanks for your prompt response.

I have tried with your given code earlier but can't understand in which place I should place it.

Would you please let me know?

Regards
PervezDear Sir

I have done it. Thanks for your NICE co-operation.


Regards
talorababu

1362.

Solve : [JAVA] Problems running application?

Answer»

Hello, Im trying to MAKE a VERY simple application that will draw a castle on the screen (still adding more stuff to it) for a school assignment, but when im working on it in my IDE (netbeans) or any other IDE for that matter, it seems to only run when IT wants to, for example, i can click the run and get this: (good)



or this: (bad)


Note that i can make NO changes to the file, run it again, and get a different result from the previous run, is there any way to fix this? or what is the cause of it.

I have the latest JAVA JDK installed on my computer btw.I've never heard of anything like this happening..
I can only suggest basic troubleshooting, trying to work out what is different when it works or doesn't.
You could also try reinstalling everything and seeing if that helps.Im thinking its cuz im using the Turtle help file that my teacher gave us, because it does the same thing on school COMPUTERS (using TextPad), and it happens when I use JBuilder, and even Netbeans on my computer at home, one sec and i can GIVE the code for the turtle file, but it is quite large. (for a post) lol

Note: It has to be something wrong in the turtle file, because it happens no matter what kind of application i try to write with it, even when i start from scratch it does it.

Turtle file:
Code: [Select]//
// Copy this file in its entirety to a file named Turtle.java
// Compile it before trying to compile any program that uses Turtles


import java.awt.*;
import javax.swing.JFrame;
import java.awt.geom.*;
import java.awt.event.*;

public class Turtle extends Object
{ public static final double DEGREE = Math.PI / 180;
public static final int WIDTH = 760, HEIGHT = 600;
public static final Color RED = Color.red, BLUE = Color.blue,
BLACK = Color.black, GRAY = Color.gray,
YELLOW = Color.yellow, PINK = Color.pink,
ORANGE = Color.orange, GREEN = Color.green,
MAGENTA = Color.magenta, WHITE = Color.white;
private static Graphics2D page = null; // for drawing
//////////////////////////////////
private double heading = 0; // heading initially east
private double xcor = WIDTH / 2; // centered horizontally
private double ycor = HEIGHT / 2; // centered vertically too

/** Set the drawing Color to the given value. */

public void switchTo (Color given)
{ page.setColor (given);
} //======================

/** Write words without changing the Turtle's state. */

public void say (String MESSAGE)
{ page.drawString (message, (int) xcor, (int) ycor);
} //======================

/** Pause the animation for wait milliseconds. */

public void sleep (int wait)
{ long timeToQuit = System.currentTimeMillis() + wait;
while (System.currentTimeMillis() < timeToQuit)
; // take no action
} //======================

/** Make a circle of the given radius, Turtle at center. */

public void swingAround (double radius)
{ if (radius > 0.0)
page.draw (new Ellipse2D.Double (xcor - radius,
ycor - radius, 2 * radius, 2 * radius));
} //======================


// the Turtle class, completed

/** Rotate left by left degrees; MOVE for forward steps.*/

public Turtle move (double left, double forward)
{ heading += left * DEGREE;
xcor += forward * Math.cos (heading);
ycor -= forward * Math.sin (heading);
return this;
} //======================

/** Rotate left by left degrees; PAINT for forward steps. */

public Turtle paint (double left, double forward)
{ heading += left * DEGREE;
double x = xcor + forward * Math.cos (heading);
double y = ycor - forward * Math.sin (heading);
page.draw (new Line2D.Double (xcor, ycor, x, y));
xcor = x;
ycor = y;
return this;
} //======================

/** Fill a circle of the given radius, Turtle at center. */

public void fillCircle (double radius)
{ page.fill (new Ellipse2D.Double (xcor - radius,
ycor - radius, 2 * radius, 2 * radius));
} //======================

/** Fill a rectangle of the given width and height, Turtle at center. */

public void fillBox (double width, double height)
{ page.fill (new Rectangle2D.Double (xcor - width / 2,
ycor - height / 2, width, height));
} //======================

public Turtle (Graphics g)
{ page = (Graphics2D) g;
} //======================

public Turtle()
{ if (page == null)
{ JFrame area = new JFrame ("Turtle drawings");
area.addWindowListener (new Closer()); // in Chapter 10
area.setSize (WIDTH, HEIGHT);
area.setVisible (true);
page = (Graphics2D) area.getGraphics();
area.paint (page);
page.setColor (WHITE);
page.fillRect (0, 0, WIDTH, HEIGHT);
page.setColor (BLACK);
}
} //======================


private static class Closer implements WindowListener
{
/** Enable the closer icon to close the window. */

public void windowClosing (WindowEvent e)
{ System.exit (0);
} //======================

public void windowActivated (WindowEvent e) { }
public void windowDeactivated (WindowEvent e) { }
public void windowIconified (WindowEvent e) { }
public void windowDeiconified (WindowEvent e) { }
public void windowOpened (WindowEvent e) { }
public void windowClosed (WindowEvent e) { }
}
}

//


Just a note, I am using the most current version of Java. Since the Turtle file is old, I'm thinking that perhaps that is causing some issues?This thread can be closed, I fixed problem by adding a sleep command to the start of my code, for some reason that makes it work 100% every time lol.Excellent one of the many mysteries of the universe solved. lol

1363.

Solve : Anything better than MSVC++??

Answer»

As the title entails, I'd like to know if there's any better IDE than Microsoft Visual C++ 2008 Express Edition. The DEBUG mode LAGS to *censored*, and once it even disconnected me from the internet. Maybe that was just my ROUTER resetting itself... again... Also, builds take forever and sometimes it even crashes on me when I have a loooong code >_>; I've already tried Dev-C++ and it didn't really work out too well xD. Anyways, a little help please? =/Check out the link, it has all major C++ IDE's free and proprietary.
http://en.wikipedia.org/wiki/Comparison_of_integrated_development_environments#C.2FC.2B.2BIf I'm on a XP machine, I'll use Visual C++ 6; if I need to run vista, I'll use another language

Although watcom C++ seemed at least as good, if not better then VC++.Quote from: BC_Programmer on May 19, 2009, 07:05:08 PM

If I'm on a XP machine, I'll use Visual C++ 6; if I need to run vista, I'll use another language

Although watcom C++ seemed at least as good, if not better then VC++.
For me, all the visual studios are laggy as heck when debugging and starting up, I got rid of them because they were taking up tooo much space for my needs.Version six isn't laggy at all. Ctrl+Alt+T shows up instantly, just like VB6's Ctrl+J.

now the .NET environments, on the other hand...Quote from: BC_Programmer on May 19, 2009, 07:39:45 PM
Version six isn't laggy at all. Ctrl+Alt+T shows up instantly, just like VB6's Ctrl+J.

now the .NET environments, on the other hand...
I mean like the 2008 ones...well, you did say "All"...Quote from: BC_Programmer on May 19, 2009, 07:50:45 PM
well, you did say "All"...
I meant all the 2008 ones. They're fairly BULKY (if you can't even INSTALL Maple Story) and very slow.2008 barely runs on my XP machine. 2005 is better. but still I ask myself why I bother since I never use them.

The professional editions come with the MSDN library, though, which I find fairly handy. I've pretty much read everything in the April 2000 MSDN library snapshot that I got with Visual Studio 6.0 a few years ago (I'm dead serious- I was reading KB articles for programs I had never even heard of- it was reading material, after all)VBS 2008 runs fine on mine XP! Quote from: Ironman on May 20, 2009, 06:50:03 AM
VBS 2008 runs fine on mine XP!
Are you sure it doesn't actually affect YOU?!Meant to say "my", was typing too fast and didn't read over my post, still have no problems with VBS 08.Quote from: Ironman on May 19, 2009, 06:53:07 PM
Check out the link, it has all major C++ IDE's free and proprietary.
http://en.wikipedia.org/wiki/Comparison_of_integrated_development_environments#C.2FC.2B.2B

Thanks... lol =P I'm running Vista HPx64 x.x So yeah debugging happens to be a biiit laggy for me what the heck is "VBS 2008"Quote from: BC_Programmer on May 20, 2009, 05:43:26 PM
what the heck is "VBS 2008"
Visual Basic 2008 or Visual Basic Studio 2008
http://www.microsoft.com/Express/VB/
1364.

Solve : Lengthdir?

Answer»

OK, I'm using a langauge that most of you won't know (GML - Game Maker Language), and two of the commands are lengthdir_x(length,direction) and lengthdir_y(length,direction). For _x, it gives the following definition:
Returns the horizontal x-component of the vector determined by the indicated length and direction.

Um.. so can anyone translate that so I COULD UNDERSTAND?Try this..

Lots more info on the Weird & Wonderful Web (aka WWW)

Good luckThanks, Dusty. I'll look into that, and (hopefully) I should be using lengthdir in no time.Gaming Master Apprentice

Oxymoron EH.....?

Well, I've learnt how to use lengthdir now, just from one look at the diagram (I didn't read through the WHOLE thing), so my game making skills have progressed.

Now, I can do code such as:
instance_create(x+lengthdir_x(20,image_angle),y+lengthdir_y(9,image_angle),shot), where the shot will always be create from exactly where your gun is, no matter which way you face.

So yeh.Good to HEAR of your progress, look forward to you posting your completed game and letting us know where to have a go.

Cheers.

1365.

Solve : which language??

Answer»

Quote from: NEIL on August 02, 2007, 02:53:43 PM

JavaScript, a real language (yes it is) ..
how can you substantiate this statement? at least SHOW it to the OP by giving references.I didn't miss javascript.... did you follow the link I posted? Oh my God... the OP didn't ask for a "my language is bigger than yours" fight!

Javascript (also called JScript or JS for short) is a healthy complement to your HTML. It's a very handy tool that makes your web pages much more dynamic. Buttons that move images or change them with other images. Add text to a div depending on user input. A heck of a lot is available with JS.

Tutorials:
www.w3schools.com/js/default.asp
www.webteacher.com/javascript/
www.echoecho.com/javascript.htm

I could go on forever.

When you are interested in starting to write actual programs, for the computer, I recommend starting with a simple language, such as Visual Basic, to learn the basic concepts of programming. After you can write some FAIRLY complicated code (manipulating files is a good checkpoint), move on to other, more widely used LANGUAGES, such as C++, C#, Java, Python (for games), etc. It's really up to you. I went from VB to C++ myself.

Good luck, and feel free to write back for any help understanding any languages you try. If we know the answer, we'll help you out.
1366.

Solve : help! create windows log file?

Answer»

I have a POWER box that build for power cyling test.
the TIMER is fixed on:30sec off:10secs through AC power. when power on, the system goes into windows XP.
But i need to create a log FILE to count , how many TIMES its on successful and failed.
Anybody know where should i start, cuz i'm REALLY noob in software.

thanks alots

1367.

Solve : VB auto-click?

Answer»

is there a way to make a Visual basic form or w/e that will aoutomatically click in a certain spot on the screen?LIKE i would define points in on the screen where to click and it would click there, then in like 10 seconds it would click ANOTHER point. Like in the code TYPE pixel NUMBERS for where to click; (480,272) then click (480,300) or something like that.

1368.

Solve : Help with Microsoft SDK?

Answer»

Hi,

I am new to this domain.

What's exactly is "Microsoft SDK".

Have a bit of knowledge of Visual Studio.
Its the Windows compiler, now how does SDK fit into the picture.

Thanksread this
http://en.wikipedia.org/wiki/Microsoft_Platform_SDKThanks,

Will get back after reading.Back,

It might be simple for other people, but since i am not from programming background its giving me some trouble.

Its sounds similar to Visual Studio, then how do i differentiate between them.

ThanksYou can't compare Visual Studio and the Microsoft Platform SDK. VS is an IDE and the second is a SDK.
So you will usually still need an IDE like VS if you want to CREATE programs using the Microsoft Platform SDK. Thanks,

Things look like to getting in place,

Just correct me if i am wrong.

IDE (VS) CONTAINS the compiler and you can't get AHEAD without it.

SDK on the other hand is required only when you need to complex programming pertaining to a particular system, as it contains API's and binaries pertaining to that type of system.Almost correct.
A SDK can contain a compiler and an IDE doesn't always have a compiler.
Visual studio have the compiler necessary for working with the Microsoft SDK, but the SDK also contains a compiler (in case you're working with an IDE that doesn't have it.)

If we were talking about Java, the IDEs you would usually work with like Netbeans or Eclipse, don't have a compiler but rely on you installing the SDK from SUN.

So an SDK is a collection of APIs, (often) a compiler, debugging tools and miscellaneous tools.

The IDE gives you a development environment with a editor that knows the syntax of the language you're working with, integrated debugging tools, (SOMETIMES) a compiler, tools that ease compiling, etc.Wow,

That was it.

Thanks for that majestic explanation.

1369.

Solve : Messaging System Help?

Answer» HI all, im TRY to make a messaging system for a program in MAKING in Visual BASIC.
1370.

Solve : CD Burner and DLLS??

Answer» HI all, im MAKING some CD burning software (summer project for fun) and i need help with the burning part.
do i need any dlls, if so, how do i create the dlls? and can i just copy the files to CD with My.Computer.copy.**** ETC?I am guessing your LANGUAGE is VB?
You need a cd burning API in order to do that. So you'll either have to write your own from scratch (if you even have to ask this is way above your level) or utilize an existing API.
Check out this site:
http://www.vbaccelerator.com/home/VB/Type_Libraries/IMAPI_(CD_Burning)/article.asp
Or do a bit of googling.Well.... I've been googling for the last 5 hours for it so would i have to do it in C++ (upgrading project) or just use the API?Well... To make it more intresting, im going to do from scratch in C++ or C#.
Got any Tips or Ideas?You will need to familiarize yourself with windows drivers and how to create them.
You would need to find out how to interact with the burner and what commands they expect.
etc, etc.

Basically making a low level API is a very advanced stuff. I would suggest you use an existing API.i was reading the API's article and i didn't understand what they say and then i need to get C++ to do it any way.
1371.

Solve : how to check missing log?

Answer»

got a list which CONTAIN the date and TIME for my windows logging.
each interval time is APPROX 3mins.
after i manually calculate,found that in 24hrs ,certain time, the windows failed to log.
how to find the missing log?
it got thounsands over logs,which i can't CHECK it one by one.
can i just with a formula and find the log?
any language,application....?

example of my log:
17/08/2007 05:13:55
17/08/2007 05:16:34
17/08/2007 05:19:14
17/08/2007 05:21:54
17/08/2007 05:24:34
17/08/2007 05:27:14
17/08/2007 05:29:55
17/08/2007 05:32:34
17/08/2007 05:35:14
17/08/2007 05:37:54
17/08/2007 05:40:34
17/08/2007 05:43:14
17/08/2007 05:45:54
17/08/2007 05:48:34
17/08/2007 05:51:14
17/08/2007 05:53:54
17/08/2007 05:56:34
17/08/2007 05:59:14
you want to find the missing intervals in the log file, or are you asking how to find out why its not logging?
i want to find out how many time it FAIL to log.

1372.

Solve : How to run VB Application in front??

Answer»

Hi !

Is there a WAY to run VB application in front of everything?
For EXAMPLE, when I OPEN Microsoft WORD, I don't want VB application window to go back.

Osman
You'll need to use the Windows API. Check out this technique for Always On Top

Good luck.

1373.

Solve : Legal Hacking on my own machines?

Answer»

I want to learn to hack so that I can hack into my own machines. I have three computer sitting here and one is begging to to be used. Can someone give me some tips on hacking so that I can hack my poor little lonely computer. I have no intentions of getting involved in malicious activity. I just want to boost my programming intelligence. HELLLP! Can someone also tell me why it is SAID that Linux is better for learning to hack than windows IN DETAIL. Oh yeah, feel free to break things down as if you are explaining things to a guy who has been locked in a 3-wall room with no media access for 20 years.Advising you on hacking on an OPEN forum would be like printing the info in a daily newspaper for all to read. Besides I'm sure it would be against forum rules.

You may not wish to engage in any malicious activity, others may.

Quote from: zite.1 on August 19, 2007, 05:45:02 PM

Can someone give me some tips on hacking..
learn how your computer works, learn how the different OSes work. learn how to program.Get to know your computerQuote from: zite.1 on August 19, 2007, 05:45:02 PM
I just want to boost my programming intelligence.
teaching you how to hack wont accomplish that just like teaching you to hot wire a specific car model doesn't increase your overall knowledge about motor vehicles.
Instead you should learn how the different parts of a computer work and interact. Learn how NETWORKS work and learn a couple of programming languages.Well said, Deerpark. And Dusty is right...talking about this on an open forum could open a can of worms that we don't want to be responsible for. And for that very reason, this is indeed against forum rules and I will be locking this topic to avoid any unwanted information.
1374.

Solve : ACCESS HELP?

Answer»

im TRYING to grab one field from a table(HBATE.BATE), can placing it to another table(ATL)...like join/merge one UNIQUE field with another table...im having problems...i made this query...and its saying
the query...

SELECT bate, val, doc, BREAK, TASK, PATH
FROM ATL INNER JOIN HBATES
ON ATL.bate = HBATES.BATE;

this is the error i get
"the specified 'bate' could refer to more than one table listed in the FROM clause of your SQL statement"

can ANYONE TELL me what im doing wrong??
Try defining the table source of the bate field in the select statement:

Code: [Select]SELECT atl.bate, val, doc, BREAK, TASK, PATH
FROM ATL INNER JOIN HBATES
ON ATL.bate = HBATES.BATE;

OR

Code: [Select]SELECT hbates.bate, val, doc, BREAK, TASK, PATH
FROM ATL INNER JOIN HBATES
ON ATL.bate = HBATES.BATE;

By defining two tables in the FROM clause with same name fields, simply using the unqualified bate field name is ambiguous.

Good luck.

1375.

Solve : JAVA GUI problem, advanced String representation.?

Answer»

Hi there,

I'm working on a little project with a friend of mine, that is supposed to end up with being an online BOOKING system for a FESTIVAL. Therefore there's some economics INVOLVED in this, like how many PEOPLE are going to sleep there and for how long etc.

We're then trying to display this equation, so it's easy to see what they pay for and how much. But I simply do not know how to do that. It should look something like this:


Anyways, I'm pretty much hardcoding it, though I had NetBeans set up the frame for me, and then I manually changed all the code afterwards to make sure it was just like I wanted it to be (using GroupLayout). I'm using the javax.swing.* package if that's any help?

I've tried to display it in a JTextArea, but I can't seem to find a way to do it.

Any good IDEAS?

1376.

Solve : VB script copying across networks?

Answer»

hey all,

I'm trying to write a vb script that will copy a batch file to another Pc across my network.

This is what i have so far but it doesn't work and keeps pointing the copyfile line as a reason for the failer, but tbh i can't see where it's going wrong.

any ideas???


Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Dim fso
CONST OverwriteExisting = True
fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile("C:\batch\remote.bat", "\\10.1.0.100\c$\remote.bat", OverwriteExisting)
MessageBox.Show("Transfer Complete")
VBScript or VB.Net?

Try something like this for VBScript:

Code: [Select]Dim fso
Const OverwriteExisting = True
SET fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile "C:\batch\remote.bat", "\\10.1.0.100\c$\remote.bat", OverwriteExisting
MessageBox.Show("Transfer Complete")

I'm guessing input and output paths are correct. cheers for the reply,

in answer to UR question vb script.

i get a (ctl_e_permissiondenied) error.

I have no idea as to how to GAIN access of the remote machine.

If this where dos i'd use

net use \\10.1.0.100 /user:me spottydog
copy c:\batch\remote.bat \\10.1.0.100\c$\remote.bat
pause

but since i moved over to vbscript today i'm finding it hard to get the commands i require in.

any help is very much appreciated. You can duplicate the batch code, but you'll need a network object exposed so you can use the MapNetworkDrive method:

Code: [Select]Dim fso, WshNetwork
Const OverwriteExisting = True
Set WshNetwork = CreateObject("Wscript.Network")
Set fso = CreateObject("Scripting.FileSystemObject")

WshNetwork.MapNetworkDrive "X:", "\\10.1.0.100\c$\"

fso.CopyFile "C:\batch\remote.bat", "X:\remote.bat", OverwriteExisting
MessageBox.Show("Transfer Complete")

I used drive X: arbitrarily, change it if you wish. Note that the remote machine must be up and running, presumably with File & Printer Sharing For Microsoft Networks activated.

Good luck.

Normally I'd ping the other machine to see it's availability, but that requires the Windows Management Interface which will only complicate things right now.thanks.

Have done as requested but i now get "unauthorizedAccessException was unhandled" error.

It seems to be having problems with the permissions on both machines, i'm logged on as admin on both so i can't see why.

can i add a /user:me spottydog line in somewhere here?

WshNetwork.MapNetworkDrive "X:", "\\10.1.0.100\c$\"

any more ideas?Forgot about the name and password:

WshNetwork.MapNetworkDrive "X:", "\\10.1.0.100\c$\" ,, me, spottydog

Questions:

Are you using wscript or cscript?

Which line in the script threw the error?

Can you ping 10.1.0.100 from the command prompt?

The reason I ask is that "unauthorizedAccessException was unhandled" is a rather odd error coming from VBScript. Might be permissions. Can you run a directory listing on X: if you map it manually with net use?

Let us know. thanks again for replying,

I have put the;

WshNetwork.MapNetworkDrive "X:", "\\10.1.0.100\c$\" ,, me, spottydog - line in, but

,, me, spottydog become's , , me, spottydog and it tell me that it not valid.

I am able to ping it from a prompt (actual pc i'm post from now)

The line that threw the error was this very line (before the ,, me, spottydog bit)

?Sometimes I amaze myself with my carelessness. Literals need to be quoted. I promise to write that on the board 100 times.

WshNetwork.MapNetworkDrive "X:", "\\10.1.0.100\c$\" ,, "me", "spottydog"

With any luck that should work. right,

I've added the quotes but it still wont copy anything.

This is what i have;

Dim fso, WshNetwork
Const OverwriteExisting = True
WshNetwork = CreateObject("wscript.network")
fso = CreateObject("scripting.filesystemobject")
WshNetwork.mapnetworkdrive("x:", "\\10.1.0.100\c$", , "username", "password")
fso.CopyFile("C:\batch\remote.bat", "x:\remote.bat", OverwriteExisting)
MessageBox.Show("Transfer Complete")

The red line brings up an error saying "access is denied", but i know that the username and password to be right.

have i got them the wrong way round???

I have checked and i can map to 10.1.0.100\c$ from a run box, (windows does ask for the guest password - which i don't know!)

cheers again for ur helpQuote

The red line brings up an error saying "access is denied", but i know that the username and password to be right.

Quote
I have checked and i can map to 10.1.0.100\c$ from a run box, (windows does ask for the guest password - which i don't know!)

These statements seem contradictory. Do you know the user & password? Is there a user & password?

Quote
have i got them the wrong way round???
UserID and password are in the correct order. Whether they have the correct values is the question.

Do not use parenthesis for MapNetworkDrive or Copyfile. When I tried your code, I got a syntax error. Also it's set fso.....you are creating an instance of the FileSystemObject not equating two variables.

Code: [Select]Dim fso, WshNetwork
Const OverwriteExisting = True
WshNetwork = CreateObject("wscript.network")
Set fso = CreateObject("scripting.filesystemobject")
WshNetwork.mapnetworkdrive "x:", "\\10.1.0.100\c$", , "username", "password"
fso.CopyFile "C:\batch\remote.bat", "x:\remote.bat", OverwriteExisting
MessageBox.Show("Transfer Complete")

You never told us whether you're using wscript or cscript.



That "unauthorizedAccessException was unhandled" message still has me puzzled. Yes, the user name and password are right.

I can map to the path in the script (\\10.1.0.100\c$) but when the authentication windows pops up it has the \\computer name\guest inserted in the username and it's grayed out so i can't change it.

Since there is no password on the guest account and you can't leave the authentication password field empty when mapping, i can't open the c:\. Hence why i use an admin account, both of the machines that I'm using are mine, so i have full access to all accounts.

As to your question about weather i'm using wscript or cscript, thb i don't know!!!!

I have installed Microsoft visual basic 2005 SP1, I opened it up and then opened a new project. (if there's a way of telling let me know and I'll check for you.)

I have this code inserted under a handle of button4 (click)

Dim fso, WshNetwork
Const OverwriteExisting = True
WshNetwork = CreateObject("wscript.network")
Set fso = CreateObject("scripting.filesystemobject")
WshNetwork.mapnetworkdrive "x:", "\\10.1.0.100\c$", , "username", "password"
fso.CopyFile "C:\batch\remote.bat", "x:\remote.bat", OverwriteExisting
MessageBox.Show("Transfer Complete")

The set that you refer to keeps disappearing after i put it in. (i have copied your code and replaced it for mine, But i still get strange errors like, "access denied" and "path not found".

I have tried subbing the c:\ on the remote machine for a newly made e:\ thats shared, but it made no difference. (also tried to map to the e:\ but still got the guest username inserted in the user field)

I have also tried to use the computer name instead of the ip but as I'm on a LAN VPN extension from work, (where there is another Pc with the same name) it keeps saying "access denied"

As i said yesturday I have only just started using vb so i'm a complete newbee, (but i'm willing to try to work it out for my self)

If there is anything else that you can suggest, (i might start a new project and just have that simple code to get to work first before making the form menu.) that would help i would forever be in your debt.

Thanks again




Quote
I have installed Microsoft visual basic 2005 SP1
I suspected as much. You are using VB.Net which is a full fledged programming language. You can certainly use VB.Net for your project, but if all you need is to copy a file(s) across the network, VBScript is much easier and a LOT less overhead. Plus there is none of that pesky compiling and linking.

To use VBScript, copy & paste the code that has been posted into your editor (Notepad works fine). Save the script with a VBS extension. Open up a command prompt and run the script as:

cscript scriptname.vbs

You can learn all about VBScript at the Microsoft Script Center.

Good luck. cheers,

I'm gonna to do that for this, but also have a larger program in mind.

I currently have about 7/8 batch files that transfer files and run batch files on remote machines. I then have a menu.bat that simply points to the files needed for the operation that you've requested.

Due to it getting bigger and bigger and because of my staff needing to use it as well, I require a windows based grafical interface. I think i'll just start by having bguttons on the from and then when clicked openning the batch file that deals with it. once i've read up some more i move to converting the batch files them-selfs to vb script.

Thanks very much for your time and effort. (if i manage to accomplish this any time soon I'll post on this thread.)
1377.

Solve : ascii to image?

Answer»

Hi ..i want to know how to convert ascii values to correspondin Imagecan SOMEONE atleast tell me if it is possible or notHmm I've heard of image to ascii CONVERTERS but not the other way around.
The only thing I could FIND was this SCRIPT for The Gimp.
http://users.ecs.soton.ac.uk/cjg/script-fu/ASCIItoImage/actually i had seen tht code before(i googled ascii2image)...


Now tht i have the code,what do i do with it..
whr do i use that code...........Can't really help you there... all I can tell you is that you need The Gimp and Script-Fu.hey plzzzzzzz.........
help me..........
i have gimp ,but i dont know if i have the script-fu

1378.

Solve : link for Data structure?

Answer»

hi,i am learning c++...
can someone suggest a GOOD WEBSITE where i can LEARN data structures using c++.(preferably sites which are simple and easy to understand).
I WANT to know where we use data structures and how important it is....Googling for 'c++ data structures tutorial' (without the ') got 1,870,000 hits.

Here is the first..

Good luckHi ,

Here is the first link to know how many TYPES of data structure :

http://en.wikipedia.org/wiki/List_of_data_structures

This is the link to know the use of data structure in programming :

http://en.wikipedia.org/wiki/Data_structure

http://en.wikipedia.org/wiki/Stack_(data_structure)

1379.

Solve : programming language?

Answer»

i apologize if i am stepping on anyones toes with this message, i am just beginning to LEARN about "threads" and all this other fun stuff. my question is does anyone know what PROGRAMMING LANGUAGE motorola uses in their cell phones. I want access to the software in my phone and i was wondering if anyone out there could help me?Do you mean access as in reverse engineering the software on it? Or do you just want to make PROGRAMS for your phone?I dont want to engineer it necessarily, rather i want to look at the code that verizon updates and i want to understand what effect they have via their software updates on the effectiveness of my phone. Well, I Googled Motorola "programming language", and found this. Is it helpful at all?

Quote

MPL (Motorola Programming Language) generates code for the Motorola 6800

Goto this site, and Ctrl+F (Find) Motorola Programming Language.Hi,


It is not confirm that which language commonly all mobile phone manufacturing company are using. However Nokia and SONY are use Python and Java for mobile applications.

Generally, Nokia and sony are using Symbian Operating system.

Please follow the link below for more information on symbian OS.

http://en.wikipedia.org/wiki/Symbian

Hope this information help you.
1380.

Solve : Copy directory / subdirectory to another drive?

Answer»

Have been USING the following (visual basic BASED?):
FileCopy "D:\Nos.pdf","E:\Nos\Production.pdf"
to copy individual files from the D drive directory to
the E drive directory.

What code should be used to copy the particular directory
from the D drive to the E drive directory?

(The above filecopy script is only a part of another main
script).

Thanks.
Hi ,

You may use the SHELL command in VB Script to RUN a XCOPY command with /s feature. The command would be

SHELL "XCOPY D:\dirname F:\ /s

Hope this will help.Quote from: HU on JULY 19, 2007, 01:24:08 AM

Have been using the following (visual basic based?):
FileCopy "D:\Nos.pdf","E:\Nos\Production.pdf"
to copy individual files from the D drive directory to
the E drive directory.

What code should be used to copy the particular directory
from the D drive to the E drive directory?

(The above filecopy script is only a part of another main
script).

Thanks.

check the visual basic help for FileCopy. If you read that, you can get the answer.
1381.

Solve : help with VB.net shell command?

Answer»

hey all,

I've written a program in VB.net.

Most of the commands it runs are in dos and VB calls the relevent batch files to complete.

I'm LOOKING for the command to pop a " messagebox.show ("Commands Completed") " message once the the batch file has finished.

My mate saids there is an extention that goes on the end of the shell command below;

(whole form)

Public Class Formecho

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Buttechorun.Click
Dim printerChoice As String

If RadButHp.Checked = True Then
printerChoice = "b"
Else
printerChoice = "a"

End If
Shell("\\swnfs01\home\blastman\batch\new\echo.bat " + printerChoice + " " + ipDetails.Text)
'MessageBox.Show("Echo Commands Completed")

End Sub

Private Sub Formecho_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub


any ideas?

maybe somthing in the bacth to say it's finished is needed??

cheers.I found this in the documentation:

Quote

Tools.Shell [/command] [/output] [/dir:folder] path [args]

Example:
Quote
ProcID = Shell("CALC.EXE", AppWinStyle.NormalFocus)

Is this the same project from last week? I still think a VB.Net program is overkill for your project, but shelling out of VB.Net to run batch files with the inherent overhead of the cmd processor is a bit counterproductive. A better approach might be using native VB.Net code to do the WORK of the batch files.

If I remember correctly, you needed a GUI. You can develop a HTA which would combine VBScript for the window event handlers, drive mapping and file copying with some HTML code for the GUI controls. The unit runs as a script in Windows and does not require the services of a browser. This is a more down and dirty approach than VB.Net but with rapid development and easier maintenance.

You can read about HTML applications at the HTA Developers Center

Good luck. my advice...try to do eveything in VB.net...if POSSIBLE..look at the batch file and see if you can redesign your code to an VB equivalent...i believe in VB, you can use open to read your ipdetails.txt files and do something about it...$0.02cheers for the POST's guys,

and yes this is still the same project.

I have around 12 functions for this to carry out. These include sending "shutdown", starting pstools, re starting services and pinging other Pc's.

It will help support over 2000 machines and will have a database of IP addresses, so the user only need enter a store number (5 digit's) and ping all Pc's on that site's IP range

I do intend to convert the batch files into VB.net at some point but because this is my first real project I'm taking it one step at a time. I had already written all of the batch files and used them my self but "for the greater good" I'm making something more usable for everyone else.

I have since posting this been advised by a friend that i can have a status window which displays the last lines of the batch file. This works well but i now have the problem that i need VB.net to write a batch file with user inputted values inserted so that status can just run one batch file with no added " + values +)

I'll have a hunt around......
1382.

Solve : Need windows.h?

Answer»

I am trying to FIND a copy of windows.h to download. I write in assembly, but have a .cpp file to MAKE and need it. I DO not WANT to dl the SDK file to get it.

Thanks.Don't know what to tell you if you don't want the SDK... the header file doesn't appear to be available for SEPARATE download.

1383.

Solve : URGENT computer programming question?

Answer»

Express 102410 as a polynomial in each of the BASES: DEC, HEX, OCT, BIN. To express this number in HEX, OCT, and BIN, you need to covert it to the given system first.This is a computer support forum not a "Hey wont you guys do my homework for me?" forum.Especially not when we get "URGENT" shouted at us in capital letters. That is such a good way of making sure you don't get any useful answers! You'd think people WOULD realise...


Ha Newbie indeed
Also if I see PLEASE READ or worse, PLZZZ READ in a header, it makes decide to NOT READ that post or open the THREAD... Elementary psychology I'd have thought.

1384.

Solve : C program for keyboard?

Answer»

I have to develop a C prgram, in which, if I press Numeric Key 1 instead of 1 appearing on screen some PROGRAM defined statments should appear e.g 'FIRST KEY' Homework?CONSULT your text book THANX a lot...I GOT my required after a bit of brainwash....
thanx again for ur ADVISE

1385.

Solve : windows boot log?

Answer»

I need a windows boot log, so that everytime my system booting up,
there is a boot log file stored in C drive for every clycle.
example:
29/08/07 12.00a.m
29/08/07 12.30a.m

But i really don't know where to start,i'm not familiar in windows environment.
Needs your help.
thanks.You didn't mention your OS.

Start==>Run==>MSCONFIG

Click the boot.ini tab then click the /bootlog checkbox under Boot Options. This will create a bootlog.txt in the root directory of the boot drive.

You could use any spreadsheet or DATABASE program to analyze the log.

Good luck. so when i open the bootlog.ini under C:,
i can see the date and time when the system booting up?

i hope win2K and VISTA have the same options too.does them?Here is the definition of the Win.XP Boot.ini /bootlog option:

Causes Windows to write a log of the boot to the file %SystemRoot%\Ntbtlog.txt.

-----------------------------------------------------------------------------------------

Quote from: only_lonely on August 31, 2007, 01:19:05 AM

so when i open the Ntbtlog.txt under %SystemRoot%
i can see the date and time when the system booting up?


Yes - and a whole lot more.

Note that the bootlog Ntbtlog.txt is created in %SystemRoot% not C:

It's the same in Win.2k.

Boot.ini does not exist in Vista, here's a bit of info on its replacement:

"Boot.ini: Ever since NT 3.1, it's been an ASCII TEXT file on the hard disk. With Vista, that's all changed; it maintains a boot file called the Boot Configuration Data or BCD, located on the boot volume (that is, the volume that the operating system (OS) boots from, no matter what Microsoft calls it) in a folder named BOOT. @34447I It's one of those files locked open by the operating system (like the *.EVT event log files), so you can't edit it in the normal manner, and because that means that it'll be tougher for the odd bit of malware to modify it. Don't go looking to edit it from the Control Panel, either; the STARTUP and Recovery dialog box is still in Control Panel hidden a few layers down, but where the XP version of that dialog had a button labeled "To edit the startup options manually, press Edit," that doesn't exist in Vista anymore. Instead, there's bcdedit.exe, a command-line tool for messing with Vista boot options"

Good hunting.oh..no this is not what i wanted.the ntbtlog.txt contains too many text
Service Pack 2 9 3 2007 08:29:03.500
Loaded driver \WINDOWS\system32\ntoskrnl.exe
Loaded driver \WINDOWS\system32\hal.dll
Loaded driver \WINDOWS\system32\KDCOM.DLL
Loaded driver \WINDOWS\system32\BOOTVID.dll
Loaded driver ACPI.sys
Loaded driver \WINDOWS\System32\DRIVERS\WMILIB.SYS
Loaded driver pci.sys
..........
i just want date and time
imagine that if i reboot my unit every 4mins,wow...too many unwanted text in the ntbtlog file...
anybody could help me to create a simple time log?
Put the following into your Startup folder as a .bat file (or create a shortcut to it in your Startup folder):
------------------------------------------------------------------------------------------------
@echo off
cls
echo Windows Started %date% %time% >> c:\startup.txt
------------------------------------------------------------------------------------------------

It will write an entry to C:\Startup.txt on every boot. Change the text string and path\filename to suit your requirements.

Good luck
Oh.thanks ,works for me.

Windows Started 05-Sep-07 8:28:59.26
1386.

Solve : python calculator?

Answer»

hi i'm new to python and i'm trying to make a calculator. It's PURPOSE is to calculate the price of a certain number of UNITS of a product.

Code: [Select]s1 = int(raw_input ("How many units do you need? "))
s2 = int(raw_input ("What is the price per unit? "))
print "The total price for the total number of units is" + (s1*s2)

please tell me why it won't WORK

thanks
frankly, you can just run in with the Python interpreter and it will show you why it won't work. I have found the fault using the interpreter. i want you to try that too..

1387.

Solve : Programming Question "This is not IE7, this is %name of my browser%"!!!!!?

Answer»

how do i get EVERYTHING to say this is what ever the name is instead of ie?
and another question.
how do i get my APP to do this.
download a txt.
if the number in it is higher that APPS version number, it will download a zip file, extract it, and copy into the apps directory so ill be able to PROVIDE updates.
i've been thinking about this in class and almost got in trouble BECUASE i was right VB code in my textbook.
plz help!!!!!
thanks in advance!!!!!

1388.

Solve : Thats not bog standard code, mr. judge!?

Answer»

just a quick question. I made a computer program in VISUAL Basic.net for my sci fair and the judges thought it was bog standard code! How can I (if possible) prove it wasn't? (and it really wasn't, it took me 3 months to write!)From what I could FIND out, bog standard code is defined as something ordinary or basic, but often in a dismissive or derogatory way. Not knowing what your program does or what wow factor the judges were LOOKING for, it's hard to say what you could do in this situation.

Perhaps you could use this as a learning experience for next year. In the long run you CAME out ahead anyway....you learned VB.NET!

I wonder if Bones92 meant that the judges thought that his code was example code cribbed from a VB examples or tutorial site or other source or copied out of a book.

The best way to show that code is yours, in my opinion, is to document it thoroughly, (plenty of remarks) know it inside out, keep early draft and test versions to demonstrate the development process, and write a kind of 'lab REPORT' detailing how you wrote the code and why you did it the way you did.

What did you mean, Bones92?

i heard from one of the teachers in charge they thought my code was just that: example code that had been changed a bit. As it was a science fair, i did have logs of everything i had done and when I wrote it, plenty of remarks, three flow charts detailing how the program ran... and they thought it was all something nicked of a tutorial site. (even though the program when run told the user I had made it.) Maybe because I acknowledged the MSDN library in my evaluation? (but I had too, MSDN tought me how to program lol)This happens. Just goes to show the poor standard of knowledge that many science fair judges have. There's not really any way you can prove it's your code. They are going to believe what they are going to believe. At least you know it's yours and you know you can do it again. Which means you can improve on it. Don't let them get you down. Just keep plugging away and keep improving your skill set.I think that what the judges may have meant was, not that you plagiarized your code, but that the project concept was one which you might find on a code demo site, or a thousand other places, that it was not sufficiently unusual or original, even if you did write all the code yourself.

1389.

Solve : making a menu?

Answer»

I'm trying to make a menu just to get the HANG of making them, and I'm running into a problem. Here's basically what I have so far...
@ECHO OFF
cls
:start

ECHO.

ECHO.

ECHO Welcome to Selection Paradise

ECHO.

ECHO 1 Internet Explorer

ECHO 2 Mozilla

ECHO 3 Exit Browser Selection Program

ECHO.

choice Choose Browser: /C:123 /N /t7

IF ERRORLEVEL 3 GOTO END

IF ERRORLEVEL 2 Start I:\Program Files\Mozilla Firefox\firefox.exe

IF ERRORLEVEL 1 start I:\progra~1\intern~1\iexplore.exe

:END

The problem is everytime I try to test run it, it gives me the "(blank) is not recognized as an internal or EXTERNAL command.... yada yada yada.
In this instance it says it about CHOICE. What am I doing wrong? How can I resolve this ISSUE? I've looked all over the internet for HELP but can't really find anything to correct it. Any help would be great.Put quotes around Choose Browser:

I think that should do it

Al968Also,
IF ERRORLEVEL 2 Start "" "I:\Program Files\Mozilla Firefox\firefox.exe"
IF ERRORLEVEL 1 start "" I:\progra~1\intern~1\iexplore.exe

1390.

Solve : Detect PE Format Methology?

Answer»

Hello,

I am trying to detect whether a file is a PE or not, as I KNOW there are many ways to do that here is how I want to check:
I want it to read the first few characters of the file if they are MZ then my program will consider them PE's ?
Is this a reliable method ?
Actually wat I am looking for is a technique that detects all the PE but may (by accident) classify a file as a PE When its really not.

As FAR as the Code goes I am fine I just need to know if this is technicly correct ?

Thanks

Al968This file would be detected as executable by your method but it is not ;-)

Quote

MZy Bad Spelling
Egggs
Bakon
Saucissses de Toulouse

More seriously,

Quote
All Windows executable files begin with a MS-DOS executable stub, so we first test for a valid MS-DOS executable using information from the MS-DOS program header that is present in every executable file. We then check for markers for a 16 bit or 32 bit Windows executable or for a virtual device driver (VXD). If we establish the file is a Windows executable we look for information that determines whether the file is an application or is a DLL. A review of the MS-DOS, Windows NE (16 bit) and PE (32 bit) executable file formats leads us to note the following:

* All DOS program files (and therefore Windows executables) begin with a "magic number"; the word value $5A4D ("MZ" in ASCII).

* We use the DOS header to check that the file length exceeds or is equal to the minimum length of the DOS executable and that the offset of the DOS relocation table lies within the file.

* Windows executables have a header record WHOSE offset in the file is given by the long word at offset $3C.

* The Windows header begins with a "magic number" word whose value INDICATES whether this is a 16bit (NE format) or 32 bit (PE format) executable or a virtual device driver (LE format). The word is $454E ("NE" in ASCII), $4550 ("PE") or $454C ("LE").

* 32 bit Windows executables have an "image header" immediately following the $4550 magic number. This header structure has a Characteristics field which is a bit mask. If the bit mask contains the flag IMAGE_FILE_DLL then the file is a DLL, otherwise it is a program file.

* 16 bit Windows programs have a byte sized field at offset $0D from the start of the Windows header which is a bit mask providing information about the file. If this field contains the flag $80 then the file is a DLL, otherwise it is a program.

See here (where I got the above) and much more including a flow chart.

http://www.delphidabbler.com/articles?article=8

and here

http://www.google.co.uk/search?source=ig&hl=en&q=detect+windows+executable&btnG=Google+Search&meta=




Ok great information, just an other quick question is the "magic" number that stated PE on the second line of the program ?

Thanks

Al968Quote from: al968 on September 09, 2007, 04:45:17 PM
is the "magic" number that stated PE on the second line of the program ?

The Windows header's offset in the file is given by the long word at offset $3C. Don't know what you mean by "line" in this context.

here's a little perl snippet you can use to get file header. I only tested on a exe file. you can follow the rest of what contrex has posted to get PE headers...may or may not work though.
Code: [Select]use warnings;
my $file = "c:/someapplication.exe";
my $success = 0;
my $hex;
if (open(FH, $file)) {
binmode(FH);
my $bin;
sysread(FH,$bin,20);
close(FH);
$hex = uc(UNPACK("H*",$bin));

}
print $hex;
1391.

Solve : File Format and Open with?

Answer»

how can i make a file for that my app opens? like....
".swd" which stands for "saved website data".if you are doing your own application, just make sure you code reading and writing for/to files with extension .swd. Otherwise, i don't understand what you want.i got the file format down. i need it to when you double click it, it opens the file in my APP instead of just opening the app.see here for referenceit doesn't RELATE to my problem. im trying to make it when i double click a ttxt file, my app opens the txt file in its self, not just open the app.what does you app do exactly..? what kind of app is that.? normally when you double click a text file, either notepad or wordpad (at LEAST i know notepad is default on my machine) opens the text file right? Now you want your app to open it correct? You have to associate the text file to be opened with your app instead of notepad/or whatever app. Also, notepad knows how to open the text file, does you app know? anyway, if you are still STUCK after trying to associate, post whatever you can post , eg your code or others so ppl can help you. I think i get what you mean, right click go to open with then there is a box you can CHECK ALLWAYS open with this pro..........

1392.

Solve : Full path display?

Answer»

How do I display the full path of a filename when working with batch files? I've been working on this for about an hour and can't figure it out.Show what you have done for your batch ATTEMPT.
@echo off

rem Batch Program to Add a Prefix to Filename in the Current
remDirectory and its Subdirectories

rem Name: (blank) Date: 9/6/07
remFilename: AddPrefixSub.bat

remThis batch program receives a prefix and a file
remspecification as replaceable parameters,
remand for each matching file in the current directory
remand its subdirectories, renames it,
remadding the word to the beginning of the filename.

remJump to error message if you did not type both
rem a word and a filespec as parameters:
if TEST%2 == test GOTO :ERR

rem Rename each matching file, adding the word:
for /r %%a in (%2) do ren "%%~a" "%1 %%~nxa"

remEnd the program:
GOTO :EOF

:ERR
remError message if you left out the prefix and filespec:
echo Please include one prefix and one filespec,
echo like this:
echo AddPrefixSub prefix filespec

I want to add a command that will show the full path of the filename. And I want to add it between the DO and the REN on the line with the For command, using an & operator after the command and before REN. I'm just not sure of the command. I've looked everywhere I can think of. Everybody on here seems to be a great help to me, so thanks in advance. It's not that easy learning how to do this kind of stuff. Quote from: marco on September 10, 2007, 02:51:14 AM

I want to add a command that will show the full path of the filename.
for /?
Code: [Select] %~I - expands %I removing any surrounding QUOTES (")
%~fI - expands %I to a fully qualified path name
%~dI - expands %I to a DRIVE letter only
%~pI - expands %I to a path only
%~nI - expands %I to a file name only
%~xI - expands %I to a file extension only
%~sI - expanded path contains short names only
%~aI - expands %I to file attributes of file
%~tI - expands %I to date/time of file
%~zI - expands %I to size of file
%~$PATH:I - searches the directories listed in the PATH
environment variable and expands %I to the
fully qualified name of the first one found.
If the environment variable name is not
defined or the file is not found by the
search, then this modifier expands to the
empty string

The modifiers can be combined to get compound results:

%~dpI - expands %I to a drive letter and path only
%~nxI - expands %I to a file name and extension only
%~FSI - expands %I to a full path name with short names only
%~dp$PATH:I - searches the directories listed in the PATH
environment variable for %I and expands to the
drive letter and path of the first one found.
%~ftzaI - expands %I to a DIR like output line

Quote
if test%2 == test GOTO :ERR

What is this line supposed to do?

1393.

Solve : How to study PHP??

Answer»

Hello....
I WANT to study PHP but I have no experience about it. Can you help me?
Thank for helping.... There are plenty of online tutorials you can try...
http://www.google.com/search?hl=en&safe=off&q=how+to+learn+php
(Google search took less than a second to perform.)

But I think the best method is to actually take a class on it.You should try this website: www.w3schools.com. It has loads of tutorials on PHP, HTML, XML, JavaScript, and lots of others.

You actually have to download and install PHP on your computer first. You can do this at: www.php.net.

Happy programming!amazon.com has a lot of great php books.
The book that gave me my jump start was "PHP/MySQL Programming for the Absolute Beginner" by Andy Harris. But any other BEGINNING php book would do just as well.
I had played AROUND with php for a few months before I got a book and hadn't learned much but after I bought ONE, I figured out tons of stuff.

1394.

Solve : C Sharp .exe Encryption?

Answer»

Hi,

I have made a program in C Sharp, I compiled to .exe and i wnat to know if is possible to encrypt this exe for nobody to decompile them. I try with some EXTERN exe encryptor but with not any result

Please some one to give me a solution

Thanks a lot If it can be executed, it can be decompiled.
I FIND some exe encryptors but is shareware.
I DONT want to encript all files, ony one class, to protect some informations

thanks contrex, but i want to see other oppinionsQuote from: XtaszY on SEPTEMBER 07, 2007, 02:38:40 PM

thanks contrex, but i want to see other oppinions

Don't hold your breath You could always write your own encryptor
look on www.sourceforge.net or www.freshmeat.net for one SOMEONE has already made.
1395.

Solve : run time error 5 in bespoke website software?

Answer»

Hi

Im not too techno jargon minded so please go easy on me

I had some bespoke software desinged a few years back which basically allows me to ammend my website offline via a program made up of FORMS - the website is www.lakesandvalleys.co.uk (not the best written site in world but thats another issue )

The software basically converts the info I input to update the html files within the folder, then i upload the full folder with updated html files, images ETC.

The program software seems to be a .csv file run in excel, i click on a program called webupdate which has TASC after it (where you would get HTML document, BAS etc) in the folder are also the following webupdate files

webupdate.bas
webupdate.frx
webupdate.vbw
webupdate.frm
webupdate.vbp

As far as i know these are basically what create the program and if i fill in the forms within the software i basically create a new webpage in html without having to use any coding.

In past have managed to fix run time errors - often if changed Pc and not put the folder in C drive it causes problems.

Been PLAYING up all week so downloaded all the files off the server onto PC and it worked for a few days, then suddenly get run time error 5 message again. What i did notice and thought strange was the files and html pages downloaded off the server wernt as upto date as what the actual website was, couldnt understand this as assume the website displays the most recent version of a file uploaded onto the server.

Any ideas why i get the errors, am sure years ago fixed it once with a VB patch but again thats not worked, even tried registery mechanic which claims to fix run time errors and no joy.

The person who wrote the software lacks serious customer care always did, as soon as had the money that was it, and constantly had to chase him if had any problems (just did a search for his name/company and found a bad/unpaid debt listed from 2004.... need i say more)

Any help would be really appreciated as have come to a dead end

Thanks

Martindont know if it helps but even when go into BACKED up folder on usb pen and external h/d the software still plays up - not sure if fault/virus on PC (running kaspersky, spy dr, some freebie firewall, registery mechanic so unlikely??)

However just to confuse things tried it on laptop reading files off usb pen and works fine, could it be a virus or similar that has removed SOMETHING on my PC as both run xp?

(just tried removing all folders, reloading back on PC from usb pen and doesnt work still run time error )computerNOhope.com

1396.

Solve : Check this code for me????

Answer»

hi ll,

I've have some vb.net (2005) code that I've written below,

It SEEMS to display that it can't find the file in the status listbox. This to me seems strange as the 2 batch files that it uses are indeed there and named right,

Could someone please just PASS an eye over this code for me to make sure i haven't MADE some school boy error!

Code: [Select]Imports system.io

Public CLASS formtest
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles testrun.Click

'writes box1.text to a txt file for go.bat to import
Shell("c:\2go.bat " + box1.Text)
' Set start information.
Dim start_info As New ProcessStartInfo("c:\3go.bat")
With start_info
.UseShellExecute = False
.CreateNoWindow = True
.RedirectStandardOutput = True
.RedirectStandardError = True
End With
' Make the process and set its start information.
Dim batch As New Process()
batch.StartInfo = start_info

' Start the process.
batch.Start()

' Attach to stdout and stderr / display.
Dim std_out As StreamReader = batch.StandardOutput()
Dim std_err As StreamReader = batch.StandardError()
Dim display = std_out.ReadLine + std_err.ReadLine
' Display the results.

Formstatus.statuslist.HorizontalScrollbar = True
Formstatus.statuslist.Items.Add(display)
Formstatus.Show()


Me.Close()


' Clean up.
std_out.Close()
std_err.Close()
batch.Close()

cheers guys

1397.

Solve : open Folder?

Answer»

Hello
Can anybody TELL me HOW to open folder & DISPLAY its contents in winows XP from MSDOS Batch file ?
with thanksdir/s drive\path\foldername. For other options to use with dir COMMAND, type dir /? at the command prompt.Thanx a lot
I got it

1398.

Solve : Set a Date Field restriction in a Microsoft Access database?

Answer»

If I want to restrict the year that can be entered in a DATE field, what would the code be in the event procedure?

THANKS, in ADVANCE, for any suggestions.

1399.

Solve : Viewing and Sending System Info With VB6?

Answer»

Hi all,

I need to know if anybody knows how to send system information by email with Visual Basic 6, such as windows version, version make, etc... The reason I need such weird code is that, my aunt that lives in Germany wants me to help her to find what windows version she is running, she dosent know how to copy and paste, much less bring up her system information, and she speaks broken ENGLISH so she dosent understand when I TELL her 'Open Control Panel.' I figure, if I COULD send her a program that sends me the information, I won't have to talk her through it over the phone for an hour. I can program VB6 at an intermediate LEVEL, but I can't understand how you would send information through email

Thanks
-ILikeMyComputerQuote from: ilikemycomputer on August 06, 2007, 04:50:11 PM

She wants me to help her to find what windows version she is running, she dosent know how to copy and paste, much less bring up her system information
But I presume she can read?

Just tell her to right-click on My Computer and select Properties and read what is says under System.

Another good free program she can download is System Information for Windows but if she doesn't know how to download anything then you're a bit stick.
1400.

Solve : too many arguments - Visual basic?

Answer»

i am trying to make my app close out of my first form and open the second but i get the error "too many arguments to 'Public sub hide()'." I am a complete noob to VB. I have tried looking around on the web for an answer and its all pretty complicated. heres the peice of code i cant get to work.
Code: [Select]Me.Hide(Me)
Form2.Show(Form2)the error is quite intuitive. if you GIVE one argument to hide() and it complains of too many arguments, then don't give it any arguments... try that.
as much as i hate to say this, but, since you are a newbie, you should go get a book on vb and read/learn how to use vb first. (or search the internet if you can't get any vb BOOKS). great it makes sence - EXCEPT THE FACT THAT IT WOULDNT DO ANYTHING WITHOUT THE ARGUMENT. how would it hide this if i take off the code that TELLS it to hide? and as far as books im not spending money on books at this point. i hardly know if i like visual basic, i wouldnt go out and spend all the money i have on a book about it. As i said i tried searching the web for this and didnt understand what people said.Quote from: gamerx365 on July 17, 2007, 03:56:25 PM

and as far as books im not spending money on books at this point.
you have never been to a library?yeah thats great if you can get to a library. maybe ill go to one sometime in the next coule of weeks if i pay my parents. lol. anyway i just want to know how to fix this problem. i have the whole program done but this part and ive tried EVERYTHING i can think of which isnt much so...gamerx365 you weren't really clear on whether or not you've tried not using any arguments for hide(). I.e. instead of Me.Hide(Me) then just Me.Hide(). Now I haven't coded in VB for quite some time but I'm pretty sure that's the way to use it.Quote from: gamerx365 on July 15, 2007, 08:41:20 PM
Code: [Select]Me.Hide(Me)
Form2.Show(Form2)
Yes Deerpark is correct you only need to use
Code: [Select]Form2.Show
Me.Hide
It BETTER to show the next Form then Hide the first one.