cgeier 187 Junior Poster

Is power connected to the hard drive? If so, you may consider using a power supply tester to ensure your power supply is functioning properly.

Here is a page stating that they are selling a 2 tb hdd pulled from a working Dell 760. Therefore, it must be possible to use a 2 tb drive in that model.

This is a genuine OEM Dell Optiplex 760 7200RPM hard drive. This hard drive was pulled from a working Dell Optiplex 760 computer and is guaranteed to work with all Dell Optiplex 760 computers.

Optiplex 760 and 3TB Hard Disk Windows 7

Beyond 2TB
Using a hard drive larger than 2.1TB on Windows-based computer systems may require special setup considerations

Beyond 2TB Video

cgeier 187 Junior Poster

What hard drive brand/model?

Which version of the Optiplex 760 do you have?

Here are the power specs:
OptiPlex 760 Desktop Tech Specs

Mini-Tower

305W Standard Power Supply; 255W 88% Efficient Power Supply, ENERGY STAR 5.0 compliant, Active PFC

Desktop

255W Standard Power Supply; 255W 88% Efficient Power Supply, ENERGY STAR 5.0 compliant, Active PFC

Small Form Factor

235W Standard Power Supply; 255W 88% Efficient Power Supply, ENERGY STAR 5.0 compliant, Active PFC

Ultra Small Form Factor

220W External PSU, ENERGY STAR 5.0 compliant.

The following article may be of interest:
Dell Optiplex 760 Upgrade Project

mouaadable commented: thank you +1
cgeier 187 Junior Poster

Please provide the table structure and some sample data from each table/database.

cgeier 187 Junior Poster

Please provide the budget for your project so someone may contact you regarding your project. If you want help with YOUR code, provide your code and where you are having difficulty. You might want to check out Google--it'll save you money. Try searching for "HTTPWebRequest" and "HTTPWebResponse".

cgeier 187 Junior Poster

If you want to see the message comment out line #27 exit(1);

In VC++ you can do the following to see where your program is running:

Add include statement:

#include<direct.h>

Then add the following code to "Payroll::Payroll"

char* buffer;
string curDir;

// Get the current working directory: 
if( (buffer = _getcwd( NULL, 0 )) == NULL )
{
      perror( "_getcwd error" );
}
else
{
    curDir = buffer;
    printf("Current Directory: %s \n", buffer);
    free(buffer);
}

Then change

from:

cout<<"Sorry Data File is not Found"<<endl;

to:

cout<<"Sorry Data File is not Found (" << curDir << ")" << endl;

Better yet, you can make the path of your input file fully-qualified to ensure that the file is where you expect it to be.

Resource:
_getcwd, _wgetcwd

cgeier 187 Junior Poster

What brand/model of computer? Did you check the manufacturer's website for technical specs?

cgeier 187 Junior Poster

I agree with tinstaafl, re-write your code to get rid of the "GoTo" statements and use TryParse instead. Also you may consider using "OrElse" instead of "Or".

(OrElse and Or) and (AndAlso and And) - When to use?

Issue: ...something is wrong wth CalcMiscCharge missing a return statement...

Resolution: It is because of your use of the GoTo statements. There are situations where you may GoTo "ReDo:". When this occurs, there is no return statement. To fix that problem, you could do the following:

ReDo:

Return MiscCharges

However, as stated above, you really should re-write your code to get rid of the GoTo statements--they are seldom necessary. Also, using them will cause you problems when you switch to a language that doesn't have them.

cgeier 187 Junior Poster

Looks like UPS has a program for software developers. Did you contact them?

UPS Developer Kit

UPS Developer Kit Community

UPS Developer Resource Center

UPS Ready Program

cgeier 187 Junior Poster

This documentation also provides some information on Maxicode (although it doesn't look like their product supports .NET).

cgeier 187 Junior Poster

I've modified version 1 (to eliminate redundant code). Here is the updated version.

Note: Version 2 (OutlookTemplateHelper_v2) remains unchanged.

Add reference to Outlook Object Library:

  • Project
  • Add Reference
  • COM
  • Microsoft Outlook xx.x Object Library

Add the following "using statements":

  • using System.Runtime.InteropServices;
  • using Outlook = Microsoft.Office.Interop.Outlook;

Declare the constants as seen below:

//Content-id - MIME
private const string PR_ATTACH_CONTENT_ID_A = "http://schemas.microsoft.com/mapi/proptag/0x3712001E";
private const string PR_ATTACH_CONTENT_ID = "http://schemas.microsoft.com/mapi/proptag/0x3712001F";

// binary attachment data
private const string PR_ATTACH_DATA_BIN = "http://schemas.microsoft.com/mapi/proptag/0x37010102";

//formatting info for attachment
private const string PR_ATTACH_MIME_TAG = "http://schemas.microsoft.com/mapi/proptag/0x370E001F";
private const string PR_ATTACH_MIME_TAG_A = "http://schemas.microsoft.com/mapi/proptag/0x370E001E";

//set to true for hidden attachments
// undefined otherwise and will throw an exception if queried
private const string PR_ATTACHMENT_HIDDEN = "http://schemas.microsoft.com/mapi/proptag/0x7FFE000B";

//create instance of Outlook.Application
private static Outlook.Application oApp = new Outlook.Application();

//create a new instance of MailItem for merged template
private static Outlook.MailItem mergedMailItem = null;

mergeTemplate:

private static void mergeTemplate(ref Outlook.MailItem mergedMailItem, string templatePath)
{
    string tempDir = System.Environment.GetEnvironmentVariable("TEMP");

    if (!tempDir.EndsWith(@"\"))
    {
        tempDir += @"\";
    }//if

    //put first template into a MailItem
    Outlook.MailItem tempMailItem = oApp.CreateItemFromTemplate(templatePath);

    //merge HTMLBody from newMail1 and newMail2
    mergedMailItem.HTMLBody += tempMailItem.HTMLBody + System.Environment.NewLine;

    if (tempMailItem.Attachments.Count > 0)
    {
        for (int i = 1; i <= tempMailItem.Attachments.Count; i++)
        {
            string tempFn = tempDir + tempMailItem.Attachments[i].FileName;

            //save attachment from template to temp file
            tempMailItem.Attachments[i].SaveAsFile(tempFn);

            //add attachment
            Outlook.Attachment mergedMailItemAttachment = mergedMailItem.Attachments.Add(tempFn);

            //delete temp file
            System.IO.File.Delete(tempFn);

            //get content-id from template
            string imageCidA = tempMailItem.Attachments[i].PropertyAccessor.GetProperty(PR_ATTACH_CONTENT_ID_A);
            string imageCid = tempMailItem.Attachments[i].PropertyAccessor.GetProperty(PR_ATTACH_CONTENT_ID); …
cgeier 187 Junior Poster

The following seems to work with Outlook 2010:

Add reference to Outlook Object Library:

  • Project
  • Add Reference
  • COM
  • Microsoft Outlook xx.x Object Library

Add the following "using statements":

  • using System.Runtime.InteropServices;
  • using Outlook = Microsoft.Office.Interop.Outlook;

Declare the constants as seen below:

//Content-id - MIME
private const string PR_ATTACH_CONTENT_ID_A = "http://schemas.microsoft.com/mapi/proptag/0x3712001E";
private const string PR_ATTACH_CONTENT_ID = "http://schemas.microsoft.com/mapi/proptag/0x3712001F";

//binary attachment data
private const string PR_ATTACH_DATA_BIN = "http://schemas.microsoft.com/mapi/proptag/0x37010102";

//formatting info for attachment
private const string PR_ATTACH_MIME_TAG_A = "http://schemas.microsoft.com/mapi/proptag/0x370E001E";
private const string PR_ATTACH_MIME_TAG = "http://schemas.microsoft.com/mapi/proptag/0x370E001F";

//set to true for hidden attachments
//undefined otherwise and will throw an exception if queried
private const string PR_ATTACHMENT_HIDDEN = "http://schemas.microsoft.com/mapi/proptag/0x7FFE000B";

mergeTemplates:

private void mergeTemplates(string templatePath1, string templatePath2)
{

    string tempDir = System.Environment.GetEnvironmentVariable("TEMP");

    Outlook.Application oApp = new Outlook.Application();

    if (!tempDir.EndsWith(@"\"))
    {
        tempDir += @"\";
    }//if

    //put first template into a MailItem
    Outlook.MailItem newMail1 = oApp.CreateItemFromTemplate(templatePath1);

    //put second template into a MailItem
    Outlook.MailItem newMail2 = oApp.CreateItemFromTemplate(templatePath2);

    //create a new MailItem for our merged template
    Outlook.MailItem mergedMailItem = oApp.CreateItem(Outlook.OlItemType.olMailItem);

    //merge HTMLBody from newMail1 and newMail2
    mergedMailItem.HTMLBody = newMail1.HTMLBody + System.Environment.NewLine + newMail2.HTMLBody;


    if (newMail1.Attachments.Count > 0)
    {
        for (int i = 1; i <= newMail1.Attachments.Count; i++)
        {
            string tempFn = tempDir + newMail1.Attachments[i].FileName;

            //save attachment from template to temp file
            newMail1.Attachments[i].SaveAsFile(tempFn);

            //add attachment
            Outlook.Attachment mergedMailItemAttachment = mergedMailItem.Attachments.Add(tempFn);

            //delete temp file
            System.IO.File.Delete(tempFn);

            //get content-id from template
            string imageCidA = newMail1.Attachments[i].PropertyAccessor.GetProperty(PR_ATTACH_CONTENT_ID_A);
            string imageCid = newMail1.Attachments[i].PropertyAccessor.GetProperty(PR_ATTACH_CONTENT_ID);

            //set content-id
            mergedMailItemAttachment.PropertyAccessor.SetProperty(PR_ATTACH_CONTENT_ID_A, imageCidA);
            mergedMailItemAttachment.PropertyAccessor.SetProperty(PR_ATTACH_CONTENT_ID, imageCid);

            //make attachment hidden
            mergedMailItemAttachment.PropertyAccessor.SetProperty(PR_ATTACHMENT_HIDDEN, true);

            //set …
cgeier 187 Junior Poster

Try adding the following between line 9 and 10:

record.MoveFirst

Other versions you can try:

record.Open SQL, con, adOpenDynamic, adLockOptimistic

record.MoveFirst

Do While record.EOF = False

    '...

    record.MoveNext
Loop

or

record.Open SQL, con, adOpenDynamic, adLockOptimistic

record.MoveFirst

Do Until record.EOF

    '...

    record.MoveNext
Loop
cgeier 187 Junior Poster

Are you required to use InputBox? Not sure why you are using ListBox for those things.

  1. Prompt user for French marks (handle invalid entries)
  2. Prompt user for German marks (handle invalid entries)
  3. Prompt user for Spanish marks (handle invalid entries)
  4. Add marks to ListBox
  5. Calculate percentage mark
  6. Display result

Note: Re-check your calculation. Consider displaying your message using a Label, MessageBox, etc.

Consider using a ComboBox for each mark type and populate it with numbers 1-30.

Danny_7 commented: Hey, i was asked by a teacher to use a listbox, anyways is that the pseudocode then yea? +0
cgeier 187 Junior Poster

In addition to the above, in "HardwareHelperLib" change from:

DeviceInfoData.cbSize = 28;

To:

//for 32-bit, IntPtr.Size = 4
//for 64-bit, IntPtr.Size = 8
if (IntPtr.Size == 4)
{
    DeviceInfoData.cbSize = 28;
}//if
else if (IntPtr.Size == 8)
{
    DeviceInfoData.cbSize = 32;
}//if

Note: There are two occurrences of the above (one in "SetDeviceState", and another in "GetAll").

Also, ensure that you are compiling for "Any CPU".

Resources:

SP_DEVINFO_DATA (Structures)

...for 32 bit SP_DEVINFO_DATA.cbSize=28, for 64Bit SP_DEVINFO_DATA.cbSize=(28+4)=32...

How to know in run time if i'm on x86 or x64 mode in c#

...You can check whether IntPtr.Size is 4 or 8...

cgeier 187 Junior Poster

The following may be of interest:
Packet loss

Here are a few ideas.

Possible issue 1:
Packet loss due to network flooding. This could be caused by a bad network card, a virus, etc.

Tests:
Unhook all computers except for one, and test for packet loss. Repeat for the other two computers.

Repeat test using a clean computer--one that has a newly installed OS, or one that is known to work from another site--this will eliminate any computer hardware issues and the possibility of a virus/malware. Connect this computer to the cable from one of the other computers.

Possible Issue 2: Noise/interference on/in the cabling from the environment (such as fluorescent lighting, or other electro-magnetic interference)

Test:
Using clean computer, repeat test close to the router, using a 1-2 m cable to connect to the router. Disconnect all other cables at the router. Test for packet loss again.

cgeier 187 Junior Poster

Have you considered just creating a third template that has the necessary info on it? Why do you feel you need to automate it?

cgeier 187 Junior Poster

If the control is in a group box or panel, you need to search there for it. Think of it as searching for a file you stored in a directory "c:\temp". If you only search in "c:\" you won't find it, you need to look in "c:\temp". Likewise, group boxes and panels are containers.

cgeier 187 Junior Poster

It doesn't look like those tables have the appropriate information. You may be able to use check date. However, you probably should have kept track of pay period start date and pay period end date.

cgeier 187 Junior Poster

You didn't copy the code correctly. Copy the code as is, line-by-line.

Check line #6:
BtnName = selectedBtn should be BtnName = selectedBtn.Name

Also, when renaming variables, rename all occurrences of the variable.

Pre-requisites:

  • Add 5 buttons to a form named "Form1.vb", name them as follows: A3, A4, A5, A6, A7

Form1.vb:
Note: I changed "sender.BackColor" to "selectedBtn.BackColor"--although either will work.

Public Class Form1

    Private BtnName As String = String.Empty

    Private Sub A3_Click(sender As System.Object, e As System.EventArgs) Handles A3.Click, A4.Click, A5.Click, A6.Click, A7.Click
        Dim selectedBtn As Button = sender

        If String.IsNullOrEmpty(BtnName) Then
            BtnName = selectedBtn.Name
            selectedBtn.BackColor = Color.Red
        Else If BtnName = selectedBtn.Name Then
            BtnName = String.Empty
            selectedBtn.BackColor = Control.DefaultBackColor
        Else
            'can only select 1 btn
            MsgBox("You can only select one seat for every Process")
        End If

    End Sub

End Class

Note: In this kind of scenario, one should probably be able to click on another button without having to de-select the previous one. Change the color on the previous button pressed back to the default color, and change the color of the newly pressed button to red.

cgeier 187 Junior Poster

I agree with others that other controls may be more appropriate. However, if you do need to use buttons, you can use the following:

Private BtnName As String = String.Empty

Private Sub A3_Click(sender As System.Object, e As System.EventArgs) Handles A3.Click, A4.Click, A5.Click, A6.Click, A7.Click
    Dim selectedBtn As Button = sender

    If String.IsNullOrEmpty(BtnName) Then
        BtnName = selectedBtn.Name
        sender.BackColor = Color.Red
    Else If BtnName = selectedBtn.Name Then
        BtnName = String.Empty
        sender.BackColor = Control.DefaultBackColor
    Else
        'can only select 1 btn
        MsgBox("You can only select one seat for every Process")
    End If

End Sub
cgeier 187 Junior Poster

What if a user wants to de-select a button and select another one? Keep track of the selected button name using a private string variable. If a button hasn't been selected or has been de-selected the value should be String.Empty. If a button is pressed and the variable = String.Empty then set variable = button name.

cgeier 187 Junior Poster

It sounds like the file you created isn't useful to you. Why don't you post the original file (or file format) and then explain what you are trying to accomplish.

cgeier 187 Junior Poster

It works for me. You need to provide more details. Also, your xp is most likely 32-bit. What version of win 7 are you using? Check to see if you are compiling for x86 or any cpu.

cgeier 187 Junior Poster

What version of .NET are you using? What version of ReportViewer did you install?

cgeier 187 Junior Poster
cgeier 187 Junior Poster

What operating system? If Vista or newer (win 7, win 8), check that the user account control settings are the same on both computers.

Also, you might want see if a simple program (such as one that only opens a message box) runs on the other computer.

MessageBox.Show("Hello World")

Additionally, you can use the attached module "Module1.vb" to retrieve some additional computer information and compare the values on both computers.

To use it, just call "getInfo":

getInfo()
cgeier 187 Junior Poster

Check the settings (properties) of the wireless adapter on the computer. Ensure that it is set to use your router is using (a/b/g...etc).

cgeier 187 Junior Poster

Reverend Jim is correct. This is C#, not VB.NET.

cgeier 187 Junior Poster

If you have VS Ultimate (2010 or newer), looks like you could add a "Modeling Project" to your solution. See the following:

How to: Create UML Modeling Projects and Diagrams

If this is for a class, you can use MS Visio or MS Word, or just draw it out on paper.

Object Modeling

Search for "Object Model"

Note: There are standards that have been defined. Shapes have a meaning (rectangle, elipse, line with arrow, etc...)

cgeier 187 Junior Poster

You've commented out the line that defines "@g" cmd.Parameters.AddWithValue... (ensure that the data type matches that of the data type in the database).

Also, in your insert, use parameterized queries.

cgeier 187 Junior Poster

Move Console.ReadLine(); inside the loop so that it pauses between loop iterations.

      ...
Console.ReadLine();

} while (true);
      ...

Add some WriteLine statements (for debugging).

           ...
number1 = number.Next(1, 31);
number2 = number.Next(1, 31);
operators = number.Next(1, 5);  // 1 = add, 2 = minus, 3 = multiply, 4 = divide

Console.WriteLine("number1: " + number1); //debugging
Console.WriteLine("number2: " + number2); //debugging
Console.WriteLine("operators: " + operators); //debugging
Console.WriteLine(); //debugging

Console.WriteLine("\tMath Problems\n");
            ...

Continue writing code to solve the rest of your identified problems:

  • Allow user to enter a numeric answer to the math problem
  • Display average score
  • Items: 4, 5, 6, 8, 9, 10, 11 that you identified above.
cgeier 187 Junior Poster

Have you thought about using an array?

Arrays

cgeier 187 Junior Poster

You could probably use a file (one file per player, if more than one player can occupy the same location) Then use getc (or fgetc) and putc (or fputc).

See the following:
getc and fgetc

Create a file format for yourself. Here is an example:

P0*00
0*000
00!00
00*00

In the above, "0" is an open position. The asterisk is an enemy. And the exclamation (!) is the winner. "P" is the player's location.

When a user chooses to move to a location, check if the location is "open", an enemy, or the finish point. Update the user's location in the file.

cgeier 187 Junior Poster

The issue is that you need to run as administrator.

Add an Application Manifest File: (to "HW_Lib_Test")

  • Click "Project"
  • Select "Add New Item"
  • Select "Application Manifest File"
  • Click "Add"

Then (in app.manifest) change from:

<requestedExecutionLevel level="asInvoker" uiAccess="false" />

To:

<requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />

In "HardwareHelperLib" in "GetAll", add HWList.Sort();, because it is annoying to look through all the output if it is not sorted.

          ...
HWList.Add(DeviceName.ToString());
HWList.Sort(); //added
          ...

Then in "HardwareHelperLib", in "ChangeIt", you have the following:

catch (Exception ex)
{
   return false;
}

It is better to print out some sort of exception message or log the error message to a file (in my opinion).

cgeier 187 Junior Poster

The attached code is written in C#. This would probably be better placed in the C# forum.

cgeier 187 Junior Poster

Add using statement: using System.Net;

Pre-requisites:

  • TextBox named: downloadURLTextBox
  • TextBox named: savePathTextBox
  • Button named: downloadBtn

Declare the following variables inside the class:

private string downloadURL = string.Empty;
private string path = string.Empty;

Create a method that gets and checks user input and appends / pre-pends as necessary:

private void getInput()
{
    //get data from textboxes
    downloadURL = downloadURLTextBox.Text;
    path = savePathTextBox.Text;

    //lower case downloadURL
    string lcDownloadURL = downloadURL.ToLower();

    //pre-pend "http://" if user didn't specify
    if (!(lcDownloadURL.StartsWith("http://") ||
          lcDownloadURL.StartsWith("https://") ||
          lcDownloadURL.StartsWith("ftp://")))
    {
        downloadURL = "http://" + downloadURL;
    }//if

    //ensure path ends with "\"
    if (!path.EndsWith(@"\"))
    {
        path = path + @"\";
    }//if

    Uri downloadURI = new Uri(downloadURL);
    string EndPathFileName = downloadURI.Segments.Last();
    path = path + EndPathFileName;
}//getInput

Download the file:

private void downloadFile()
{
    WebClient myWebClient = new WebClient();

    getInput();

    myWebClient.DownloadFile(downloadURL, path);
    myWebClient.Dispose();
}//downloadFile

Double-click the button (downloadBtn) to create "downloadBtn_Click". Then add the following code:

downloadFile();

It should look like:

private void downloadBtn_Click(object sender, EventArgs e)
{
    downloadFile();
}
cgeier 187 Junior Poster

Note: In WinPE, when in the command prompt window, you can type "exit" to reboot.

cgeier 187 Junior Poster

You can try the following:

Option 1:

  • Turn computer on. Press "F10" repeatedly (once or twice per second).
  • If prompted to "Edit Windows boot options...", press the escape key.
  • If the Windows Boot Manager screen appears ("Choose an operating system to start..."), select the OS you want to boot.

Note: If "F10" doesn't work, reboot and try another "F" key.

Option 2: Use "EasyBCD" as others have stated.

Option 3:

How to Manually Repair Windows 7 Boot Loader Problems

Option 4:
If you don't have the install DVD (or your install DVD doesn't have the "Repair your computer" option), you can create a bootable USB drive using WinPE 5.1 (it is for Win 8.1, but you should be able to use it for Win 7).

To create the bootable USB drive using Win 8 computer:

Demo 2: Installing Windows PE on a USB Drive

To create the bootable USB drive using Win 7 computer:

Download and install Windows Assessment and Deployment Kit (Windows ADK) for Windows 8.1 Update

  • Double-click "adksetup.exe".
  • You either choose Option A: "Install the Windows Assessment and Deployment Kit for Windows 8.1 to this computer" or Option B: "Download the Windows Assessment and Deployment Kit for Windows 8.1 for installation on a separate computer". (I chose Option B: "Download the Windows Assessment...", so I could save it and not have to download it again should I want to install it on another computer. If choosing Option B, …
mike_2000_17 commented: Nice complete explanation! +14
cgeier 187 Junior Poster

The following article may be of interest:

How to handle peripherals support on virtual desktops

cgeier 187 Junior Poster

You haven't provided enough detail. What is the exception that you are receiving? What is the value of "downloadURL.Text"? Does the website require you to login to use it? Have you tried any other websites?

cgeier 187 Junior Poster

What are you trying to accomplish? You need to provide more detail, such as some variable names and data types to make it easier to see what you are trying to accomplish.

Obviously, there would be no point to doing the following:

public class A
{
    public string firstName = string.Empty;
    public string lastName = string.Empty;
}//A

public class B
{
    public string firstName = string.Empty;
    public string lastName = string.Empty;
}//B

However, at times, inheritance may be of use:

public class A
{
    public string firstName = string.Empty;
    public string lastName = string.Empty;
}//A

public class B : A
{
    public string streetName = string.Empty;
    public string zipCode = string.Empty;
}//B
cgeier 187 Junior Poster

Assuming "E:\downloads" is a folder, "PathtoSave" should include the filename--not just the folder.

ex:

WebClient wc = new WebClient();

string localFilename = @"E:\downloads\myfile.txt";

wc.DownloadFile(downloadURL.Text, localFilename);

Resource:
Download Files from Web [C#]

Download file and automatically save it to folder

WebClient.DownloadFile Method (String, String)

cgeier 187 Junior Poster

PDFNet SDK

PDFTron PDFNet Contact

"PDFTron offers several licensing and pricing options to accommodate various types of application and deployment scenarios in which customers can use PDFTron products. PDFTron's goal is to provide the most flexible and cost-effective licensing that suits specific customer requirements. If you would like to consult us on selecting the license type that is best suited to your needs, don't hesitate to contact us." consult us on selecting the license type that is best suited to your needs, don't hesitate to contact us."

User Impersonation in .NET (impersusr.dll)

"...licensed under The Code Project Open License (CPOL) ..."

cgeier 187 Junior Poster

This is for C# but can be converted: C# send plain text to default printer (Zebra printer) http://stackoverflow.com/questions/19171628/c-sharp-send-plain-text-to-defult-printer-zebra-printer

cgeier 187 Junior Poster

What do you mean by "internal port for the mini usb detatched from the board"? What is the model number of the broken drive?

cgeier 187 Junior Poster

Space after "set"

cgeier 187 Junior Poster

You can't just return to MethodA. MethodA didn't call MethodD--MethodC did. Even with exceptions, if unhandled, they are passed back to the caller. An exception could potentially be passed from D to C to B to A. Also, control needs to be passed back from MethodD to MethodC so clean-up of MethodC can occur--disposing of objects. Why do you feel that you should avoid returning up the chain--from D to C to B to A?

strRusty_gal commented: Thanks =) +3
cgeier 187 Junior Poster

Doing that could result in SQL injection. Use parameterized queries as in my post above. Also, things can sometimes be written with fewer lines of code, but that doesn't necessarily mean that it is good code.

cgeier 187 Junior Poster

Add the following to the end of the script:

'====================================
'Loop through the files in the
'sub-folders in the path
'from above (objStartFolder)
'====================================

ShowSubFolders objFolder


Sub ShowSubFolders(Folder)
    On error resume next

    For Each Subfolder in Folder.SubFolders


        Set objFolder = objFSO.GetFolder(Subfolder.Path)
        Set colFiles = objFolder.Files

        For Each objFile in colFiles
            if (LCase(objFSO.getextensionname(objFile)) = "jpg") then
            oFile.Write objFolder & "\" & objFile.name & vbCrlf
            end if

        Next

        ShowSubFolders Subfolder
    Next
End Sub

So now you will have:

'====================================
'objStartFolder is where you enter 
'the folder path string
'====================================

objStartFolder = "C:\"
'objStartFolder = "C:\Users\user\Desktop\"
'objStartFolder = "C:\Temp\"

Wscript.Echo objStartFolder

'====================================
'create file system object
'====================================

set objFSO=CreateObject("Scripting.FileSystemObject")

'====================================
'outputFile is where you enter the 
'path and name of the LogFile text
'file.
'====================================

outputFile = "C:\Users\user\Desktop\LogFile.txt"


Set objFolder = objFSO.GetFolder(objStartFolder)
set oFile = objFSO.CreateTextFile(outputFile,True)

Set colFiles = objFolder.Files

'====================================
'Loop through the files in the path 
'from above (objStartFolder)
'====================================


For Each objFile in colFiles

    if (LCase(objFSO.getextensionname(objFile)) = "jpg") then
        oFile.Write objFolder & "\" & objFile.name & vbCrlf
    end if

Next

'====================================
'Loop through the files in the
'sub-folders in the path
'from above (objStartFolder)
'====================================

ShowSubFolders objFolder


Sub ShowSubFolders(Folder)
    For Each Subfolder in Folder.SubFolders

        Set objFolder = objFSO.GetFolder(Subfolder.Path)
        Set colFiles = objFolder.Files

        For Each objFile in colFiles
            if (LCase(objFSO.getextensionname(objFile)) = "jpg") then
            oFile.Write objFolder & "\" & objFile.name & vbCrlf
            end if
        Next

        ShowSubFolders Subfolder
    Next
End Sub

How Can I Get a List of All the Files in a Folder and Its Subfolders?

Stuugie commented: Thank you so much for your assistance here +5
cgeier 187 Junior Poster

The following may be of use:

To see available networks:
netsh wlan show networks

See encryption types:
netsh wlan show drivers

Note: For "Encryption", CCMP, is what shows up as "AES" in the wireless network properties. TKIP shows up as "TKIP" in the wireless network properties.

To see wireless interfaces:
netsh wlan show interfaces

See existing profiles:
netsh wlan show profiles

See profile info:
netsh wlan show profiles <profile name>

In concept, one should be able to add/create a profile using:

netsh wlan add profile

of course, one would have to create an appropriate XML file (containing the necessary information) first. As in "Deploying Wireless LAN settings with a Pre-Shared Key (PSK) from the command line" above.

Then to connect to the wiresless profile, use:

netsh wlan connect

If the information was correct, one should see that a connection was successfully made.