powered by simpleCommunicator - 2.0.55     © 2025 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / WinForms, .Net Framework [игнор отключен] [закрыт для гостей] / Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
25 сообщений из 31, страница 1 из 2
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38758883
crazyara
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Использую внешнюю библиотеку для отправки почты ospop3_plus.dll для приема почты
если использовать вне службы все нормально принимает, при вставлении в службу, выдает такую ошибку
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
ссылку на службу поставил

Protected Sub ttt_elapsed(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs)
Try
Dim Myserver As String
Dim popserver As String
Dim port As Integer
Dim login As String
Dim password As String
oSession.UseSSL = True
Myserver = "192.168.100.205"
popserver = "pop.mail.ru"
login = "yuginfo"
PrintLog2(login)
port = 995
password = "3rokswick_yuginform"
' oSession = New OSPOP3_Plus.Session
PrintLog2(port)
oSession.UseSSL = True
oSession.ServerName = popserver
oSession.PortNumber = port
oSession.Login = login
oSession.Password = password
PrintLog2(popserver)

' oSession.OpenPOP3(popserver, port, login, password)
oSession.OpenPOP3()
PrintLog2(popserver)
Dim omle As OSPOP3_Plus.MessageListEntry
Dim i As Integer
Dim m As OSPOP3_Plus.Message
Dim good As Boolean
Dim zzz As String
Dim filevloz As String
Dim tip As Integer

i = 1


'oSession.OpenPOP3(txtServer.Text, Convert.ToInt32(port), Login, txtPassword.Text)
oSession.OpenPOP3(popserver, port, login, password)

For Each omle In oSession.MessageList
m = oSession.GetMessageHeaders(i)

If UCase(m.Subject) = "MONBASE" Or UCase(m.Subject) = "MONBASEPFR" Or UCase(m.Subject) = "DAYDAY" Or UCase(m.Subject) = "DAYREG" Or UCase(m.Subject) = "DAYDAYPERSONAL" Then

zzz = m.DateSent

m = oSession.GetMessage(i, False)

Dim a As OSPOP3_Plus.Attachment
For Each a In m.Attachments


If FolderExists(My.Application.Info.DirectoryPath & "\Tmp") Then
Else
IO.Directory.CreateDirectory(My.Application.Info.DirectoryPath & "\Tmp")
End If
If FolderExists(My.Application.Info.DirectoryPath & "\Tmp2") Then
Else
IO.Directory.CreateDirectory(My.Application.Info.DirectoryPath & "\Tmp2")
End If

Dim fileName As String = ""
Dim attachmentCounter As Integer = 1
If a.AttachmentName <> "" Then
fileName = a.AttachmentName.Replace("""", "") 'attachment name may contain quotes!
Else
fileName = "attachment_" + attachmentCounter.ToString() 'file name can't be blank
If a.ContentType = "message/rfc822" Then
fileName = fileName + ".eml"
End If

End If

a.Save(My.Application.Info.DirectoryPath & "\Tmp\" & fileName)
' MsgBox(My.Application.Info.DirectoryPath)

filevloz = fileName
'pppoe = "insert into priem (email, [file],tip,datepriem,atcname,atcfile) values ('" & m.Sender.Address & "','" & m.Sender.Address & "'," & tip & ",'" & zzz & "','" & filevloz & "',)"

'IsServer(pppoe, "192.168.100.205")
' MsgBox(fileName)


Call sendtopriem(m.Sender.Address, filevloz, tip, zzz, Myserver, good)
'Exit For

Next
If good = True Then
' MsgBox("recorded")
m = oSession.GetMessage(i, True)
' MsgBox("OSPPOP DELETED")
'On Error Resume Next
Kill(My.Application.Info.DirectoryPath & "\Tmp\" & filevloz)


End If
End If
i = i + 1
Next
oSession.ClosePOP3()

Catch ex As Exception
Dim path As String = "c:\logQQQ.txt"
Dim tw As StreamWriter = New StreamWriter(path, True)
tw.WriteLine(Date.Now.ToString + "- начинаем описывать ошибку")
tw.WriteLine(ex.ToString)



Dim inner As Exception = ex.GetBaseException
tw.WriteLine("подробное описание ошибки")
tw.WriteLine(inner.Message.ToString)
tw.WriteLine("заканчиваем описание ошибки")
tw.Close()

End Try

End Sub

ошибка в логе такая, почему может быть?
System.NullReferenceException: В экземпляре объекта не задана ссылка на объект.
в OSPOP3_Plus.Session.ClosePOP3()
в OSPOP3_Plus.Session.OpenPOP3(String ServerName, Int32 PortNumber, String Login, String Password, Boolean UseSSL)
в MonitorKurier.MonitorKurier.t_elapsed(Object sender, ElapsedEventArgs e)
В экземпляре объекта не задана ссылка на объект.


в модуле класса объявляю ее
Imports System.Timers
Imports System.IO
Imports System.Net
Imports System.Net.Mail
Imports System.Threading
Imports OSPOP3_Plus
'Imports System.Net.NetworkCredential

Public Class MonitorKurier
Private t As System.Timers.Timer = Nothing
Private tt As System.Timers.Timer = Nothing
Private ttt As System.Timers.Timer = Nothing
Public WithEvents oSession As New OSPOP3_Plus.Session

что еще ему надо , почему не хочет?
...
Рейтинг: 0 / 0
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38759133
Фотография pation
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
crazyara,

отформатируй код, может тогда тебе ответят
...
Рейтинг: 0 / 0
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38759143
Фотография Shocker.Pro
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
pationотформатируй код FAQ
...
Рейтинг: 0 / 0
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38759287
crazyara
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
уберу лишнее

Код: vbnet
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
Protected Sub ttt_elapsed(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs)
Try
Dim Myserver As String
Dim popserver As String
Dim port As Integer
Dim login As String
Dim password As String
oSession.UseSSL = True
Myserver = "192.168.100.205"
popserver = "pop.mail.ru"
login = "yuginfo"
PrintLog2(login)
port = 995
password = "uginform"
' oSession = New OSPOP3_Plus.Session
PrintLog2(port)
oSession.UseSSL = True
oSession.ServerName = popserver
oSession.PortNumber = port
oSession.Login = login
oSession.Password = password
PrintLog2(popserver)

' oSession.OpenPOP3(popserver, port, login, password)
oSession.OpenPOP3()



не срабатывает метод openpop3 , который запускается из внешней библиотеки ospop3_plus.dll (компонента для приема почты)
это запускаетсмя из службы. Когда из формы все ок
ошибку пишет такую

Код: vbnet
1.
2.
3.
4.
5.
System.NullReferenceException: В экземпляре объекта не задана ссылка на объект.
в OSPOP3_Plus.Session.ClosePOP3()
в OSPOP3_Plus.Session.OpenPOP3(String ServerName, Int32 PortNumber, String Login, String Password, Boolean UseSSL)
в MonitorKurier.MonitorKurier.t_elapsed(Object sender, ElapsedEventArgs e)
В экземпляре объекта не задана ссылка на объект.



в классе службы все объявляется, что может быть?

Код: vbnet
1.
2.
3.
4.
5.
Public Class MonitorKurier
Private t As System.Timers.Timer = Nothing
Private tt As System.Timers.Timer = Nothing
Private ttt As System.Timers.Timer = Nothing
Public WithEvents oSession As New OSPOP3_Plus.Session



эта длл работает только с формами, так получается?
dll взята отсюда http://ostrosoft.com/ospop3.aspx
...
Рейтинг: 0 / 0
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38759465
bazile
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
crazyara, класс MonitorKurier это класс службы или отдельный класс который создается в OnStart()?
...
Рейтинг: 0 / 0
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38759482
crazyara
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
класс службы
...
Рейтинг: 0 / 0
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38760296
crazyara
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Так что может быть, никто не подскажет?
Почему код не работает в службе?
...
Рейтинг: 0 / 0
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38760333
Arm79
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Для начала бы побольше кода, и отформатированного, все вышеприведенное достаточно бессвязно
Во-вторых, у вас ошибка в процедуре t_elapsed возникает, а код показываете от ttt_elapsed
...
Рейтинг: 0 / 0
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38760638
bazile
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
crazyara, прочитай секцию Remarks к классу ServiceBase . Там в частности рекомендуется создавать объекты в методе OnStart и избавляться от них в методе OnStop. В обзем создавай экземпляр OSPOP3_Plus.Session внутри метода ttt_elapsed. Также неплохо добавить использование Using для корректного освобождения объекта.
...
Рейтинг: 0 / 0
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38761615
crazyara
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Сейчас ссылается на процедуру ttt , до этого не видел ту dll

Код: vbnet
1.
2.
3.
4.
5.
6.
7.
30.09.2014 10:32:02- начинаем описывать ошибку
System.NullReferenceException: Ссылка на объект не указывает на экземпляр объекта.
   в OSPOP3_Plus.Session.OpenPOP3(String ServerName, Int32 PortNumber, String Login, String Password, Boolean UseSSL)
   в MonitorScreens.MonitorKurier.ttt_elapsed(Object sender, ElapsedEventArgs e)
подробное описание ошибки
Ссылка на объект не указывает на экземпляр объекта.
заканчиваем описание ошибки



Код: vbnet
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
Imports System.Timers
Imports System.IO
Imports System.Net
Imports System.Net.Mail
Imports System.Threading
Imports OSPOP3_Plus
'Imports System.Net.NetworkCredential

Public Class MonitorKurier
    'Private t As System.Timers.Timer = Nothing
    ' Private tt As System.Timers.Timer = Nothing
    Private ttt As System.Timers.Timer = Nothing
    Private WithEvents oSession As New OSPOP3_Plus.Session
    Public alreadyProcessing
    Public alreadyProcessing2

    Protected Overrides Sub OnStart(ByVal args() As String)
        ' Add code here to start your service. This method should set things
        ' in motion so your service can do its work.
        't.Interval = 1000000
        Me.alreadyProcessing2 = False
        '  PrintLog(t.Interval)
        '  PrintLog2(tt.Interval)
        ttt.Start()
        ' tt.Start()
        ' t.Start()
    End Sub

    Protected Overrides Sub OnStop()
        ' Add code here to perform any tear-down necessary to stop your service.
        ' t.Stop()
        ' tt.Stop()
        ttt.Stop()
    End Sub
    Protected Overrides Sub Oncontinue()
        ' Add code here to start your service. This method should set things
        ' in motion so your service can do its work.
        '  t.Start()
        ' tt.Start()
        ttt.Stop()

    End Sub
    Protected Overrides Sub Onpause()
        ' Add code here to perform any tear-down necessary to stop your service.
        ' t.Stop()
        ' tt.Stop()
        ttt.Stop()

    End Sub
    Protected Sub ttt_elapsed(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs)
        Try

            Dim Myserver As String
            Dim popserver As String
            Dim port As Integer
            Dim login As String
            Dim password As String
            oSession.UseSSL = True
            Myserver = "192.168.100.205"
            popserver = "pop.mail.ru"
            login = "yuginfo"
            PrintLog2(login)
            port = 995
            password = "214"
            ' oSession = New OSPOP3_Plus.Session
            PrintLog2(port)
            oSession.UseSSL = True
            oSession.ServerName = popserver
            oSession.PortNumber = port
            oSession.Login = login
            oSession.Password = password
            PrintLog2(popserver)

            ' oSession.OpenPOP3(popserver, port, login, password)
            oSession.OpenPOP3()
            PrintLog2(popserver)
            Dim omle As OSPOP3_Plus.MessageListEntry
            Dim i As Integer
            Dim m As OSPOP3_Plus.Message
            Dim good As Boolean
            Dim zzz As String
            Dim filevloz As String
            Dim tip As Integer

            i = 1


            'oSession.OpenPOP3(txtServer.Text, Convert.ToInt32(port), Login, txtPassword.Text)
            oSession.OpenPOP3(popserver, port, login, password)

            For Each omle In oSession.MessageList
                m = oSession.GetMessageHeaders(i)

                If UCase(m.Subject) = "MONBASE" Or UCase(m.Subject) = "MONBASEPFR" Or UCase(m.Subject) = "DAYDAY" Or UCase(m.Subject) = "DAYREG" Or UCase(m.Subject) = "DAYDAYPERSONAL" Then

                    zzz = m.DateSent
                    Select Case UCase(m.Subject)
                        Case "ALLBASE"
                            tip = 1
                        Case "DOBBASE"
                            tip = 2
                        Case "MONBASE"
                            tip = 3
                        Case "MONBASEPFR"
                            tip = 4
                        Case "DAYDAY"
                            tip = 11
                        Case "DAYREG"
                            tip = 111
                        Case "DAYDAYPERSONAL"
                            tip = 1111
                    End Select
                    m = oSession.GetMessage(i, False)

                    Dim a As OSPOP3_Plus.Attachment
                    For Each a In m.Attachments


                        If FolderExists(My.Application.Info.DirectoryPath & "\Tmp") Then
                        Else
                            IO.Directory.CreateDirectory(My.Application.Info.DirectoryPath & "\Tmp")
                        End If
                        If FolderExists(My.Application.Info.DirectoryPath & "\Tmp2") Then
                        Else
                            IO.Directory.CreateDirectory(My.Application.Info.DirectoryPath & "\Tmp2")
                        End If

                        Dim fileName As String = ""
                        Dim attachmentCounter As Integer = 1
                        If a.AttachmentName <> "" Then
                            fileName = a.AttachmentName.Replace("""", "") 'attachment name may contain quotes!
                        Else
                            fileName = "attachment_" + attachmentCounter.ToString() 'file name can't be blank
                            If a.ContentType = "message/rfc822" Then
                                fileName = fileName + ".eml"
                            End If

                        End If

                        a.Save(My.Application.Info.DirectoryPath & "\Tmp\" & fileName)
                        '  MsgBox(My.Application.Info.DirectoryPath)

                        filevloz = fileName
                        'pppoe = "insert into priem (email, [file],tip,datepriem,atcname,atcfile) values ('" & m.Sender.Address & "','" & m.Sender.Address & "'," & tip & ",'" & zzz & "','" & filevloz & "',)"

                        'IsServer(pppoe, "192.168.100.205")
                        ' MsgBox(fileName)


                        Call sendtopriem(m.Sender.Address, filevloz, tip, zzz, Myserver, good)
                        'Exit For

                    Next
                    If good = True Then
                        ' MsgBox("recorded")
                        m = oSession.GetMessage(i, True)
                        ' MsgBox("OSPPOP DELETED")
                        'On Error Resume Next
                        Kill(My.Application.Info.DirectoryPath & "\Tmp\" & filevloz)


                    End If
                End If
                i = i + 1
            Next
            oSession.ClosePOP3()
            'MsgBox("Сделано!!!")
        Catch ex As Exception
            Dim path As String = "c:\logQQQ.txt"
            Dim tw As StreamWriter = New StreamWriter(path, True)
            tw.WriteLine(Date.Now.ToString + "- начинаем описывать ошибку")
            tw.WriteLine(ex.ToString)



            Dim inner As Exception = ex.GetBaseException
            tw.WriteLine("подробное описание ошибки")
            tw.WriteLine(inner.Message.ToString)
            tw.WriteLine("заканчиваем описание ошибки")
            tw.Close()

        End Try

    End Sub

   
End Class




в элапсед объявить Private WithEvents oSession As New OSPOP3_Plus.Session нельзя пишет withevents нельзя использовать локально
...
Рейтинг: 0 / 0
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38761718
Arm79
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Этот VB такой непривычный, что аж читать не хочется :-)

Тем не менее, у вас Private ttt As System.Timers.Timer = Nothing
А где вы в вышеприведенном коде его создаете?

Далее, с каким интервалом у вас срабатывает таймер? (прим. привет Алексею К., одни с таймером проблемы ). Обращение к pop3 серверу - занятие не такое быстрое. Может, у вас настолько быстро срабатывают ttt_elapsed, что переменная Private WithEvents oSession As New OSPOP3_Plus.Session в обработчике постоянно перезатирается, она же у вас общая для всех elapsed.

В-третьих, используйте не System.Timers.Timer, а System.Threading.Timer и подход, указанный здесь: 16632746
...
Рейтинг: 0 / 0
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38761746
crazyara
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
вот тут в коде servise1.designer.vb устанавливается 60 секунд
Код: vbnet
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
Imports System.ServiceProcess
Imports System.Timers
Imports System.IO
Imports System.Net
Imports OSPOP3_Plus

Imports System.Data.OleDb
Imports System.Data.OleDb.OleDbCommand
Imports System.Data.SqlClient
Imports System.Data.Common.DbCommand
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class MonitorKurier
    Inherits System.ServiceProcess.ServiceBase

    'UserService overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing AndAlso components IsNot Nothing Then
            components.Dispose()
        End If
        MyBase.Dispose(disposing)
    End Sub

    ' The main entry point for the process
    <MTAThread()> _
    <System.Diagnostics.DebuggerNonUserCode()> _
    Shared Sub Main()
        Dim ServicesToRun() As System.ServiceProcess.ServiceBase

        ' More than one NT Service may run within the same process. To add
        ' another service to this process, change the following line to
        ' create a second service object. For example,
        '
        '   ServicesToRun = New System.ServiceProcess.ServiceBase () {New Service1, New MySecondUserService}
        '
        ServicesToRun = New System.ServiceProcess.ServiceBase() {New MonitorKurier}

        System.ServiceProcess.ServiceBase.Run(ServicesToRun)
    End Sub

    'Required by the Component Designer
    Private components As System.ComponentModel.IContainer

    ' NOTE: The following procedure is required by the Component Designer
    ' It can be modified using the Component Designer.  
    ' Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        '
        'MonitorKurier
        '
        Me.CanPauseAndContinue = True
        Me.CanShutdown = True
        Me.ServiceName = "MonitorKurier"

    End Sub

    Public Sub New()

        ' This call is required by the Windows Form Designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.
        '  t = New Timer(10000)
        ' tt = New Timer(60000)
        ttt = New Timer(60000)
        '   AddHandler t.Elapsed, New System.Timers.ElapsedEventHandler(AddressOf Me.t_elapsed)
        '  AddHandler tt.Elapsed, New System.Timers.ElapsedEventHandler(AddressOf Me.tt_elapsed)
        AddHandler ttt.Elapsed, New System.Timers.ElapsedEventHandler(AddressOf Me.ttt_elapsed)
    End Sub

    Private Sub MonitorKurier_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Disposed

    End Sub
End Class
...
Рейтинг: 0 / 0
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38761756
Arm79
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
crazyara
Код: vbnet
1.
ttt = New Timer(60000)


Таймер должен быть создан в MonitorKurier
...
Рейтинг: 0 / 0
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38761840
crazyara
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
но таймер-то срабатывает, ошибка вываливается каждую минуту.
именно не срабатывает openpop3, хотя если не в службе он срабатывает
может на него ссылку не надо где-то указывать или наоборот, надо
...
Рейтинг: 0 / 0
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38762001
Фотография Konst_One
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
создавайте сессию в самом событии таймера
уберите New в определении oSession
в конце процедуры добавьте Finally и там уже делайте oSession.ClosePOP3()
...
Рейтинг: 0 / 0
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38762190
bazile
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
crazyaraв элапсед объявить Private WithEvents oSession As New OSPOP3_Plus.Session нельзя пишет withevents нельзя использовать локально
Ключевое слово WithEvents работает в паре с ключевым словом Handles упрощая подписку на события. Судя по коду ты не подписываешься на события класса OSPOP3_Plus.Session так что WithEvents можно убрать. Если в будущем понадобится подписка на события, то можно будет использовать AddHandler/RemoveHandler.

У тебя явные пробелы в базовых знаниях VB.NET. Бегом читать MSDN: WithEvents and the Handles Clause и AddHandler and RemoveHandler .
...
Рейтинг: 0 / 0
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38762246
crazyara
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
поменял вот так,
Код: vbnet
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
Imports System.Timers
Imports System.IO
Imports System.Net
Imports System.Net.Mail
Imports System.Threading
Imports OSPOP3_Plus
'Imports System.Net.NetworkCredential

Public Class MonitorKurier
    'Private t As System.Timers.Timer = Nothing
    ' Private tt As System.Timers.Timer = Nothing
    Private ttt As System.Timers.Timer = Nothing
    ' Private WithEvents oSession As New OSPOP3_Plus.Session
    Public alreadyProcessing
    Public alreadyProcessing2

    Protected Overrides Sub OnStart(ByVal args() As String)
        ' Add code here to start your service. This method should set things
        ' in motion so your service can do its work.
        't.Interval = 1000000
        Me.alreadyProcessing2 = False
        '  PrintLog(t.Interval)
        '  PrintLog2(tt.Interval)
        ttt.Start()
        ' tt.Start()
        ' t.Start()
    End Sub

    Protected Overrides Sub OnStop()
        ' Add code here to perform any tear-down necessary to stop your service.
        ' t.Stop()
        ' tt.Stop()
        ttt.Stop()
    End Sub
    Protected Overrides Sub Oncontinue()
        ' Add code here to start your service. This method should set things
        ' in motion so your service can do its work.
        '  t.Start()
        ' tt.Start()
        ttt.Stop()

    End Sub
    Protected Overrides Sub Onpause()
        ' Add code here to perform any tear-down necessary to stop your service.
        ' t.Stop()
        ' tt.Stop()
        ttt.Stop()

    End Sub
    Protected Sub ttt_elapsed(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs)
        Try
            '  Private WithEvents oSession As New OSPOP3_Plus.Session
            Dim oSession As OSPOP3_Plus.Session
            Dim Myserver As String
            Dim popserver As String
            Dim port As Integer
            Dim login As String
            Dim password As String
            oSession = New OSPOP3_Plus.Session
            oSession.UseSSL = True
            Myserver = "192.168.100.205"
            popserver = "pop.mail.ru"
            login = "yuginfo"
            PrintLog2(login)
            port = 995
            password = "214"
            ' oSession = New OSPOP3_Plus.Session
            PrintLog2(port)
            oSession.UseSSL = True
            oSession.ServerName = popserver
            oSession.PortNumber = port
            oSession.Login = login
            oSession.Password = password
            PrintLog2(popserver)

            ' oSession.OpenPOP3(popserver, port, login, password)
            oSession.OpenPOP3()
            PrintLog2(popserver)
            Dim omle As OSPOP3_Plus.MessageListEntry
            Dim i As Integer
            Dim m As OSPOP3_Plus.Message
            Dim good As Boolean
            Dim zzz As String
            Dim filevloz As String
            Dim tip As Integer

            i = 1


            'oSession.OpenPOP3(txtServer.Text, Convert.ToInt32(port), Login, txtPassword.Text)
            oSession.OpenPOP3(popserver, port, login, password)

            For Each omle In oSession.MessageList
                m = oSession.GetMessageHeaders(i)

                If UCase(m.Subject) = "MONBASE" Or UCase(m.Subject) = "MONBASEPFR" Or UCase(m.Subject) = "DAYDAY" Or UCase(m.Subject) = "DAYREG" Or UCase(m.Subject) = "DAYDAYPERSONAL" Then

                    zzz = m.DateSent
                    Select Case UCase(m.Subject)
                        Case "ALLBASE"
                            tip = 1
                        Case "DOBBASE"
                            tip = 2
                        Case "MONBASE"
                            tip = 3
                        Case "MONBASEPFR"
                            tip = 4
                        Case "DAYDAY"
                            tip = 11
                        Case "DAYREG"
                            tip = 111
                        Case "DAYDAYPERSONAL"
                            tip = 1111
                    End Select
                    m = oSession.GetMessage(i, False)

                    Dim a As OSPOP3_Plus.Attachment
                    For Each a In m.Attachments


                        If FolderExists(My.Application.Info.DirectoryPath & "\Tmp") Then
                        Else
                            IO.Directory.CreateDirectory(My.Application.Info.DirectoryPath & "\Tmp")
                        End If
                        If FolderExists(My.Application.Info.DirectoryPath & "\Tmp2") Then
                        Else
                            IO.Directory.CreateDirectory(My.Application.Info.DirectoryPath & "\Tmp2")
                        End If

                        Dim fileName As String = ""
                        Dim attachmentCounter As Integer = 1
                        If a.AttachmentName <> "" Then
                            fileName = a.AttachmentName.Replace("""", "") 'attachment name may contain quotes!
                        Else
                            fileName = "attachment_" + attachmentCounter.ToString() 'file name can't be blank
                            If a.ContentType = "message/rfc822" Then
                                fileName = fileName + ".eml"
                            End If

                        End If

                        a.Save(My.Application.Info.DirectoryPath & "\Tmp\" & fileName)
                        '  MsgBox(My.Application.Info.DirectoryPath)

                        filevloz = fileName
                        'pppoe = "insert into priem (email, [file],tip,datepriem,atcname,atcfile) values ('" & m.Sender.Address & "','" & m.Sender.Address & "'," & tip & ",'" & zzz & "','" & filevloz & "',)"

                        'IsServer(pppoe, "192.168.100.205")
                        ' MsgBox(fileName)


                        Call sendtopriem(m.Sender.Address, filevloz, tip, zzz, Myserver, good)
                        'Exit For

                    Next
                    If good = True Then
                        ' MsgBox("recorded")
                        m = oSession.GetMessage(i, True)
                        ' MsgBox("OSPPOP DELETED")
                        'On Error Resume Next
                        Kill(My.Application.Info.DirectoryPath & "\Tmp\" & filevloz)


                    End If
                End If
                i = i + 1
            Next
            oSession.ClosePOP3()

            'MsgBox("Сделано!!!")
        Catch ex As Exception
            Dim path As String = "c:\logQQQ.txt"
            Dim tw As StreamWriter = New StreamWriter(path, True)
            tw.WriteLine(Date.Now.ToString + "- начинаем описывать ошибку")
            tw.WriteLine(ex.ToString)



            Dim inner As Exception = ex.GetBaseException
            tw.WriteLine("подробное описание ошибки")
            tw.WriteLine(inner.Message.ToString)
            tw.WriteLine("заканчиваем описание ошибки")
            tw.Close()

        End Try

    End Sub












сейчас пишет вот так



Код: vbnet
1.
2.
3.
4.
5.
6.
7.
30.09.2014 15:50:18- начинаем описывать ошибку
System.NullReferenceException: Ссылка на объект не указывает на экземпляр объекта.
   в OSPOP3_Plus.Session.OpenPOP3(String ServerName, Int32 PortNumber, String Login, String Password, Boolean UseSSL)
   в MonitorScreens.MonitorKurier.ttt_elapsed(Object sender, ElapsedEventArgs e)
подробное описание ошибки
Ссылка на объект не указывает на экземпляр объекта.
заканчиваем описание ошибки
...
Рейтинг: 0 / 0
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38762274
Arm79
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Трудно сказать, у меня с работы доступ к внешним почтам ограничен, проверить не могу.
Но на C# слепленный на скорую руку сервис работает:

Код: c#
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
namespace WindowsService1
{
    public partial class Service1 : ServiceBase
    {
        private readonly Timer _timer;

        public Service1()
        {
            InitializeComponent();

            _timer = new Timer(Callback, null, Timeout.Infinite, Timeout.Infinite);
        }

        protected override void OnStart(string[] args)
        {
            _timer.Change(0, Timeout.Infinite);
        }

        protected override void OnStop()
        {
            _timer.Change(Timeout.Infinite, Timeout.Infinite);
        }

        private void Callback(object state)
        {
            using (var writer = File.AppendText(@"C:\Users\user01\Desktop\tst\1.txt"))
                writer.WriteLine(DateTime.Now.ToString(CultureInfo.InvariantCulture));

            _timer.Change(1000, Timeout.Infinite);
        }
    }
}



Содержимое файла:
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
09/30/2014 16:07:10
09/30/2014 16:07:11
09/30/2014 16:07:12
09/30/2014 16:07:13
09/30/2014 16:07:14
09/30/2014 16:07:15
09/30/2014 16:07:16
09/30/2014 16:07:17
09/30/2014 16:07:18
09/30/2014 16:07:19
09/30/2014 16:07:20
09/30/2014 16:07:21
09/30/2014 16:07:22
09/30/2014 16:07:23
09/30/2014 16:07:24
09/30/2014 16:07:25
09/30/2014 16:07:26
09/30/2014 16:07:27
09/30/2014 16:07:28
09/30/2014 16:07:29
09/30/2014 16:07:30
09/30/2014 16:07:31
09/30/2014 16:07:32
09/30/2014 16:07:33
09/30/2014 16:07:34
09/30/2014 16:07:35
09/30/2014 16:07:36
09/30/2014 16:07:37
09/30/2014 16:07:38
09/30/2014 16:07:39
09/30/2014 16:07:40
09/30/2014 16:07:41
09/30/2014 16:07:42
09/30/2014 16:07:43
09/30/2014 16:07:44
09/30/2014 16:07:45
...
Рейтинг: 0 / 0
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38762284
Фотография Konst_One
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
вы бы для начала сделали отдельный метод(или класс), где бы весь сеанс связи по POP3 проходил. снчала его оттестируйте в консоле, а уж потом в сервис засовывайте. и выведите уж наконец нормальный exception full trace в лог-файл , например с использованием NLog
...
Рейтинг: 0 / 0
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38762291
bazile
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
crazyara, почему ты два раза вызываешь метод OpenPOP3? По идее это нужно делать только один раз.
...
Рейтинг: 0 / 0
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38762324
crazyara
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
я тестировал не в консоле, а в форме - в форме все работает - здесь в Button1_Click
делается то, что в службе ttt_elapsed
ниже - код формы , там правда еще лишнее делается, выводятся сообщение почты, но все остальные процедуры там особо не нужны. Еще nlog ищу

Код: vbnet
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
250.
251.
252.
253.
254.
255.
256.
257.
258.
259.
260.
261.
262.
263.
264.
265.
266.
267.
268.
269.
270.
271.
272.
273.
274.
275.
276.
277.
278.
279.
280.
281.
282.
283.
284.
285.
286.
287.
288.
289.
290.
291.
292.
293.
294.
295.
296.
297.
298.
299.
300.
301.
302.
303.
304.
305.
306.
307.
308.
309.
310.
311.
312.
313.
314.
315.
316.
317.
318.
319.
320.
321.
322.
323.
324.
325.
326.
327.
328.
329.
330.
331.
332.
333.
334.
335.
336.
337.
338.
339.
340.
341.
342.
343.
344.
345.
346.
347.
348.
349.
350.
351.
352.
353.
354.
355.
356.
357.
358.
359.
360.
361.
362.
363.
364.
365.
366.
367.
368.
369.
370.
371.
372.
373.
374.
375.
376.
377.
378.
379.
380.
381.
382.
383.
384.
385.
386.
387.
388.
389.
390.
391.
392.
393.
394.
395.
396.
397.
398.
399.
400.
401.
402.
403.
404.
405.
406.
407.
408.
409.
410.
411.
412.
413.
414.
415.
416.
417.
418.
419.
420.
421.
422.
423.
424.
425.
426.
427.
428.
429.
430.
431.
432.
433.
434.
435.
436.
437.
438.
439.
440.
441.
442.
443.
444.
445.
446.
447.
448.
449.
450.
451.
452.
453.
454.
455.
456.
457.
458.
459.
460.
461.
462.
463.
464.
465.
466.
467.
468.
469.
470.
471.
472.
473.
474.
475.
476.
477.
478.
479.
480.
481.
482.
483.
484.
485.
486.
487.
488.
489.
490.
491.
492.
493.
494.
495.
496.
497.
498.
499.
500.
501.
502.
503.
504.
505.
506.
507.
508.
509.
510.
511.
512.
513.
514.
515.
516.
517.
518.
519.
520.
521.
522.
523.
524.
525.
526.
527.
528.
529.
530.
531.
532.
533.
534.
535.
536.
537.
538.
539.
540.
541.
542.
543.
544.
545.
546.
547.
548.
549.
550.
551.
552.
553.
554.
555.
556.
557.
558.
559.
560.
561.
562.
563.
564.
565.
566.
567.
568.
569.
570.
571.
572.
573.
574.
575.
576.
577.
578.
579.
580.
581.
582.
583.
584.
585.
586.
587.
588.
589.
590.
591.
592.
593.
594.
595.
596.
597.
598.
599.
600.
601.
602.
603.
604.
605.
606.
607.
608.
609.
610.
611.
612.
613.
614.
615.
616.
617.
618.
619.
620.
621.
622.
623.
624.
625.
626.
627.
628.
629.
630.
631.
632.
633.
634.
635.
636.
637.
638.
639.
640.
641.
642.
643.
644.
645.
646.
647.
648.
649.
650.
651.
652.
653.
654.
655.
656.
657.
658.
659.
660.
661.
662.
663.
664.
665.
666.
667.
668.
669.
670.
671.
672.
673.
674.
675.
676.
677.
678.
679.
680.
681.
682.
683.
684.
685.
686.
687.
688.
689.
690.
691.
692.
693.
694.
695.
696.
697.
698.
699.
700.
701.
702.
703.
704.
705.
706.
707.
708.
709.
710.
711.
712.
713.
714.
715.
716.
717.
718.
719.
720.
721.
722.
723.
Imports System.Data.SqlClient
Imports System.IO
Public Class frmSession
  Inherits System.Windows.Forms.Form
   
    Public WithEvents oSession As New OSPOP3_Plus.Session
    Public bHeadersOnly As Boolean

#Region " Windows Form Designer declarations "
    Private WithEvents chkSSL As System.Windows.Forms.CheckBox
    Friend WithEvents cmdRefresh As System.Windows.Forms.Button
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents label2 As System.Windows.Forms.Label
    Friend WithEvents txtNumber As System.Windows.Forms.TextBox
    Friend WithEvents txtPort As System.Windows.Forms.TextBox
    Friend WithEvents cmdConnect As System.Windows.Forms.Button
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents cmdHeaders As System.Windows.Forms.Button
    Friend WithEvents fmMessages As System.Windows.Forms.GroupBox
    Friend WithEvents cmdDelete As System.Windows.Forms.Button
    Friend WithEvents cmdView As System.Windows.Forms.Button
    Friend WithEvents lvwMessages As System.Windows.Forms.ListView
    Friend WithEvents clmID As System.Windows.Forms.ColumnHeader
    Friend WithEvents clmSize As System.Windows.Forms.ColumnHeader
    Friend WithEvents clmUIDL As System.Windows.Forms.ColumnHeader
    Friend WithEvents cmdReset As System.Windows.Forms.Button
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents txtSize As System.Windows.Forms.TextBox
    Friend WithEvents txtPassword As System.Windows.Forms.TextBox
    Friend WithEvents txtStatus As System.Windows.Forms.TextBox
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents txtServer As System.Windows.Forms.TextBox
    Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
    Friend WithEvents txtLogin As System.Windows.Forms.TextBox
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents Button2 As System.Windows.Forms.Button
    Friend WithEvents TxtSrv2 As System.Windows.Forms.TextBox
    Friend WithEvents Label1 As System.Windows.Forms.Label

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.chkSSL = New System.Windows.Forms.CheckBox
        Me.cmdRefresh = New System.Windows.Forms.Button
        Me.Label6 = New System.Windows.Forms.Label
        Me.label2 = New System.Windows.Forms.Label
        Me.txtNumber = New System.Windows.Forms.TextBox
        Me.txtPort = New System.Windows.Forms.TextBox
        Me.cmdConnect = New System.Windows.Forms.Button
        Me.Label4 = New System.Windows.Forms.Label
        Me.cmdHeaders = New System.Windows.Forms.Button
        Me.fmMessages = New System.Windows.Forms.GroupBox
        Me.cmdDelete = New System.Windows.Forms.Button
        Me.cmdView = New System.Windows.Forms.Button
        Me.lvwMessages = New System.Windows.Forms.ListView
        Me.clmID = New System.Windows.Forms.ColumnHeader
        Me.clmSize = New System.Windows.Forms.ColumnHeader
        Me.clmUIDL = New System.Windows.Forms.ColumnHeader
        Me.cmdReset = New System.Windows.Forms.Button
        Me.Label5 = New System.Windows.Forms.Label
        Me.txtSize = New System.Windows.Forms.TextBox
        Me.txtPassword = New System.Windows.Forms.TextBox
        Me.txtStatus = New System.Windows.Forms.TextBox
        Me.Label3 = New System.Windows.Forms.Label
        Me.txtServer = New System.Windows.Forms.TextBox
        Me.GroupBox1 = New System.Windows.Forms.GroupBox
        Me.Button2 = New System.Windows.Forms.Button
        Me.Button1 = New System.Windows.Forms.Button
        Me.txtLogin = New System.Windows.Forms.TextBox
        Me.Label1 = New System.Windows.Forms.Label
        Me.TxtSrv2 = New System.Windows.Forms.TextBox
        Me.fmMessages.SuspendLayout()
        Me.GroupBox1.SuspendLayout()
        Me.SuspendLayout()
        '
        'chkSSL
        '
        Me.chkSSL.AutoSize = True
        Me.chkSSL.Location = New System.Drawing.Point(148, 58)
        Me.chkSSL.Name = "chkSSL"
        Me.chkSSL.Size = New System.Drawing.Size(68, 17)
        Me.chkSSL.TabIndex = 4
        Me.chkSSL.Text = "Use SSL"
        Me.chkSSL.UseVisualStyleBackColor = True
        '
        'cmdRefresh
        '
        Me.cmdRefresh.Location = New System.Drawing.Point(448, 160)
        Me.cmdRefresh.Name = "cmdRefresh"
        Me.cmdRefresh.Size = New System.Drawing.Size(113, 23)
        Me.cmdRefresh.TabIndex = 8
        Me.cmdRefresh.Text = "Refresh Msg. List"
        '
        'Label6
        '
        Me.Label6.AutoSize = True
        Me.Label6.Location = New System.Drawing.Point(232, 26)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(88, 13)
        Me.Label6.TabIndex = 7
        Me.Label6.Text = "Number of emails"
        '
        'label2
        '
        Me.label2.AutoSize = True
        Me.label2.Location = New System.Drawing.Point(195, 26)
        Me.label2.Name = "label2"
        Me.label2.Size = New System.Drawing.Size(26, 13)
        Me.label2.TabIndex = 9
        Me.label2.Text = "Port"
        '
        'txtNumber
        '
        Me.txtNumber.Location = New System.Drawing.Point(328, 24)
        Me.txtNumber.Name = "txtNumber"
        Me.txtNumber.Size = New System.Drawing.Size(48, 20)
        Me.txtNumber.TabIndex = 7
        Me.txtNumber.Text = "0"
        Me.txtNumber.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'txtPort
        '
        Me.txtPort.Location = New System.Drawing.Point(224, 24)
        Me.txtPort.Name = "txtPort"
        Me.txtPort.Size = New System.Drawing.Size(36, 20)
        Me.txtPort.TabIndex = 1
        Me.txtPort.Text = "995"
        '
        'cmdConnect
        '
        Me.cmdConnect.Location = New System.Drawing.Point(229, 54)
        Me.cmdConnect.Name = "cmdConnect"
        Me.cmdConnect.Size = New System.Drawing.Size(113, 23)
        Me.cmdConnect.TabIndex = 5
        Me.cmdConnect.Text = "Connect"
        '
        'Label4
        '
        Me.Label4.AutoSize = True
        Me.Label4.Location = New System.Drawing.Point(400, 26)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(53, 13)
        Me.Label4.TabIndex = 7
        Me.Label4.Text = "Password"
        '
        'cmdHeaders
        '
        Me.cmdHeaders.Location = New System.Drawing.Point(448, 92)
        Me.cmdHeaders.Name = "cmdHeaders"
        Me.cmdHeaders.Size = New System.Drawing.Size(113, 23)
        Me.cmdHeaders.TabIndex = 11
        Me.cmdHeaders.Text = "View Headers"
        '
        'fmMessages
        '
        Me.fmMessages.Controls.Add(Me.cmdDelete)
        Me.fmMessages.Controls.Add(Me.cmdHeaders)
        Me.fmMessages.Controls.Add(Me.cmdView)
        Me.fmMessages.Controls.Add(Me.lvwMessages)
        Me.fmMessages.Controls.Add(Me.cmdReset)
        Me.fmMessages.Controls.Add(Me.cmdRefresh)
        Me.fmMessages.Controls.Add(Me.Label6)
        Me.fmMessages.Controls.Add(Me.txtNumber)
        Me.fmMessages.Controls.Add(Me.Label5)
        Me.fmMessages.Controls.Add(Me.txtSize)
        Me.fmMessages.Location = New System.Drawing.Point(2, 94)
        Me.fmMessages.Name = "fmMessages"
        Me.fmMessages.Size = New System.Drawing.Size(568, 192)
        Me.fmMessages.TabIndex = 20
        Me.fmMessages.TabStop = False
        Me.fmMessages.Text = "Messages"
        '
        'cmdDelete
        '
        Me.cmdDelete.Location = New System.Drawing.Point(448, 120)
        Me.cmdDelete.Name = "cmdDelete"
        Me.cmdDelete.Size = New System.Drawing.Size(113, 23)
        Me.cmdDelete.TabIndex = 12
        Me.cmdDelete.Text = "Delete Message"
        '
        'cmdView
        '
        Me.cmdView.Location = New System.Drawing.Point(448, 64)
        Me.cmdView.Name = "cmdView"
        Me.cmdView.Size = New System.Drawing.Size(113, 23)
        Me.cmdView.TabIndex = 10
        Me.cmdView.Text = "View Message"
        '
        'lvwMessages
        '
        Me.lvwMessages.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.clmID, Me.clmSize, Me.clmUIDL})
        Me.lvwMessages.FullRowSelect = True
        Me.lvwMessages.HideSelection = False
        Me.lvwMessages.Location = New System.Drawing.Point(8, 56)
        Me.lvwMessages.Name = "lvwMessages"
        Me.lvwMessages.Size = New System.Drawing.Size(432, 128)
        Me.lvwMessages.TabIndex = 13
        Me.lvwMessages.UseCompatibleStateImageBehavior = False
        Me.lvwMessages.View = System.Windows.Forms.View.Details
        '
        'clmID
        '
        Me.clmID.Text = "ID"
        Me.clmID.Width = 38
        '
        'clmSize
        '
        Me.clmSize.Text = "Size"
        Me.clmSize.Width = 91
        '
        'clmUIDL
        '
        Me.clmUIDL.Text = "UIDL"
        Me.clmUIDL.Width = 274
        '
        'cmdReset
        '
        Me.cmdReset.Location = New System.Drawing.Point(448, 24)
        Me.cmdReset.Name = "cmdReset"
        Me.cmdReset.Size = New System.Drawing.Size(113, 23)
        Me.cmdReset.TabIndex = 9
        Me.cmdReset.Text = "Reset Session"
        '
        'Label5
        '
        Me.Label5.AutoSize = True
        Me.Label5.Location = New System.Drawing.Point(16, 26)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(133, 13)
        Me.Label5.TabIndex = 5
        Me.Label5.Text = "Mailbox size, octets (bytes)"
        '
        'txtSize
        '
        Me.txtSize.Location = New System.Drawing.Point(160, 24)
        Me.txtSize.Name = "txtSize"
        Me.txtSize.Size = New System.Drawing.Size(56, 20)
        Me.txtSize.TabIndex = 6
        Me.txtSize.Text = "0"
        Me.txtSize.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'txtPassword
        '
        Me.txtPassword.Location = New System.Drawing.Point(456, 24)
        Me.txtPassword.Name = "txtPassword"
        Me.txtPassword.PasswordChar = Global.Microsoft.VisualBasic.ChrW(42)
        Me.txtPassword.Size = New System.Drawing.Size(102, 20)
        Me.txtPassword.TabIndex = 3
        Me.txtPassword.Text = "214373fhf"
        '
        'txtStatus
        '
        Me.txtStatus.Location = New System.Drawing.Point(10, 294)
        Me.txtStatus.Multiline = True
        Me.txtStatus.Name = "txtStatus"
        Me.txtStatus.ScrollBars = System.Windows.Forms.ScrollBars.Both
        Me.txtStatus.Size = New System.Drawing.Size(560, 144)
        Me.txtStatus.TabIndex = 21
        Me.txtStatus.Text = "Connection status"
        '
        'Label3
        '
        Me.Label3.AutoSize = True
        Me.Label3.Location = New System.Drawing.Point(262, 26)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(33, 13)
        Me.Label3.TabIndex = 5
        Me.Label3.Text = "Login"
        '
        'txtServer
        '
        Me.txtServer.Location = New System.Drawing.Point(48, 24)
        Me.txtServer.Name = "txtServer"
        Me.txtServer.Size = New System.Drawing.Size(141, 20)
        Me.txtServer.TabIndex = 0
        Me.txtServer.Text = "pop3.mail.ru"
        '
        'GroupBox1
        '
        Me.GroupBox1.Controls.Add(Me.TxtSrv2)
        Me.GroupBox1.Controls.Add(Me.Button2)
        Me.GroupBox1.Controls.Add(Me.Button1)
        Me.GroupBox1.Controls.Add(Me.chkSSL)
        Me.GroupBox1.Controls.Add(Me.label2)
        Me.GroupBox1.Controls.Add(Me.txtPort)
        Me.GroupBox1.Controls.Add(Me.cmdConnect)
        Me.GroupBox1.Controls.Add(Me.Label4)
        Me.GroupBox1.Controls.Add(Me.txtPassword)
        Me.GroupBox1.Controls.Add(Me.Label3)
        Me.GroupBox1.Controls.Add(Me.txtLogin)
        Me.GroupBox1.Controls.Add(Me.Label1)
        Me.GroupBox1.Controls.Add(Me.txtServer)
        Me.GroupBox1.Location = New System.Drawing.Point(2, 3)
        Me.GroupBox1.Name = "GroupBox1"
        Me.GroupBox1.Size = New System.Drawing.Size(568, 87)
        Me.GroupBox1.TabIndex = 19
        Me.GroupBox1.TabStop = False
        Me.GroupBox1.Text = "Session"
        '
        'Button2
        '
        Me.Button2.Location = New System.Drawing.Point(491, 57)
        Me.Button2.Name = "Button2"
        Me.Button2.Size = New System.Drawing.Size(69, 19)
        Me.Button2.TabIndex = 11
        Me.Button2.Text = "Orders"
        Me.Button2.UseVisualStyleBackColor = True
        '
        'Button1
        '
        Me.Button1.Location = New System.Drawing.Point(366, 57)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(115, 19)
        Me.Button1.TabIndex = 10
        Me.Button1.Text = "IP"
        Me.Button1.UseVisualStyleBackColor = True
        '
        'txtLogin
        '
        Me.txtLogin.Location = New System.Drawing.Point(295, 24)
        Me.txtLogin.Name = "txtLogin"
        Me.txtLogin.Size = New System.Drawing.Size(105, 20)
        Me.txtLogin.TabIndex = 2
        Me.txtLogin.Text = "yuginfo3"
        '
        'Label1
        '
        Me.Label1.AutoSize = True
        Me.Label1.Location = New System.Drawing.Point(8, 26)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(38, 13)
        Me.Label1.TabIndex = 1
        Me.Label1.Text = "Server"
        '
        'TxtSrv2
        '
        Me.TxtSrv2.Location = New System.Drawing.Point(48, 56)
        Me.TxtSrv2.Name = "TxtSrv2"
        Me.TxtSrv2.Size = New System.Drawing.Size(94, 20)
        Me.TxtSrv2.TabIndex = 22
        Me.TxtSrv2.Text = "192.168.100.205"
        '
        'frmSession
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(572, 440)
        Me.Controls.Add(Me.fmMessages)
        Me.Controls.Add(Me.txtStatus)
        Me.Controls.Add(Me.GroupBox1)
        Me.Name = "frmSession"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "OstroSoft POP3 Component"
        Me.fmMessages.ResumeLayout(False)
        Me.fmMessages.PerformLayout()
        Me.GroupBox1.ResumeLayout(False)
        Me.GroupBox1.PerformLayout()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub

#End Region

    Private Sub frmSession_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        fmMessages.Enabled = False
    End Sub

    Private Sub cmdConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdConnect.Click
        cmdConnect.Enabled = False
        If cmdConnect.Text = "Connect" Then
            txtStatus.Text = ""
            oSession.UseSSL = True
            oSession.OpenPOP3(txtServer.Text, Convert.ToInt32(txtPort.Text), txtLogin.Text, txtPassword.Text)
        Else
            oSession.ClosePOP3()
        End If
    End Sub

    Private Sub cmdRefresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdRefresh.Click
        GetStats()
    End Sub

    Private Sub cmdReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdReset.Click
        oSession.ResetSession()
        GetStats()
    End Sub

    Private Sub cmdDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdDelete.Click
        If lvwMessages.SelectedItems.Count > 0 Then
            If MsgBox("Would you like to delete a selected email?", vbYesNo, "Confirm") = vbYes Then
                oSession.DeleteMessage(lvwMessages.SelectedItems(0).Text)
                lvwMessages.Items.Remove(lvwMessages.SelectedItems(0))
            End If
        End If
    End Sub

    Private Sub cmdHeaders_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdHeaders.Click
        If lvwMessages.SelectedItems.Count > 0 Then
            bHeadersOnly = True
            Dim frm As New frmMessage
            With frm
                .iMessageID = lvwMessages.SelectedItems(0).Text
                .bHeadersOnly = bHeadersOnly
                .oSession = oSession
                .ShowDialog()
            End With
        End If
    End Sub

    Private Sub cmdView_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdView.Click
        If lvwMessages.SelectedItems.Count > 0 Then
            bHeadersOnly = False
            Dim frm As New frmMessage
            With frm
                .iMessageID = lvwMessages.SelectedItems(0).Text
                .bHeadersOnly = bHeadersOnly
                .oSession = oSession
                .ShowDialog()
            End With
        End If
    End Sub

    Private Sub txtStatus_Change(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtStatus.Click
        txtStatus.SelectionStart = Len(txtStatus.Text)
        txtStatus.ScrollToCaret()
    End Sub

    Private Sub oSession_Closed() Handles oSession.Closed
        '  Exit Sub
        txtSize.Text = "0"
        txtNumber.Text = "0"
        lvwMessages.Items.Clear()

        cmdConnect.Text = "Connect"
        cmdConnect.Enabled = True
        fmMessages.Enabled = False
    End Sub

    Private Sub oSession_Connected() Handles oSession.Connected
        '  Exit Sub
        GetStats()
        cmdConnect.Text = "Disconnect"
        cmdConnect.Enabled = True
        fmMessages.Enabled = True
    End Sub

    Private Sub oSession_ErrorPOP3(ByVal Number As Integer, ByVal Description As String) Handles oSession.ErrorPOP3
        'txtStatus.Text = txtStatus.Text & "Error " & Number & ": " & Description & vbCrLf
        If oSession.State = OSPOP3_Plus.Session.StateConstants.popClosed Then
            cmdConnect.Text = "Connect"
            fmMessages.Enabled = False
        Else
            cmdConnect.Text = "Disconnect"
        End If
        cmdConnect.Enabled = True
    End Sub

    Private Sub oSession_StatusChanged(ByVal Status As String, ByVal StatusType As OSPOP3_Plus.Session.StatusTypeConstants) Handles oSession.StatusChanged
        '    Exit Sub
        Dim sPrompt As String
        Select Case StatusType
            Case OSPOP3_Plus.Session.StatusTypeConstants.stPOP3Request : sPrompt = "< "
            Case OSPOP3_Plus.Session.StatusTypeConstants.stPOP3Response : sPrompt = "> "
            Case OSPOP3_Plus.Session.StatusTypeConstants.stError : sPrompt = "! "
            Case OSPOP3_Plus.Session.StatusTypeConstants.stState : sPrompt = "# "
            Case Else : sPrompt = "? "
        End Select

        txtStatus.Text = txtStatus.Text & sPrompt & Status & vbCrLf
    End Sub

    Private Sub GetStats()
        '    Exit Sub
        oSession.GetMailboxSize()
        txtSize.Text = oSession.MailboxSize
        txtNumber.Text = oSession.MessageCount

        Dim oMessageList As New Collection
        Dim oMLE As OSPOP3_Plus.MessageListEntry
        Dim li As ListViewItem

        lvwMessages.Items.Clear()
        oSession.GetMessageList()
        For Each oMLE In oSession.MessageList
            li = lvwMessages.Items.Add(oMLE.ID)
            li.SubItems.Add(oMLE.Size)
            li.SubItems.Add(oMLE.UIDL)
        Next
    End Sub

   
    Public Function IsServer(ByVal per As String, ByVal mserver As String) As String
        Dim queryString As String = per
        Dim oledbcon As New _
        System.Data.OleDb.OleDbConnection("Provider=SQLOLEDB.1;User Id=""aaad"";password=""3rokswick_yuginform"";Data Source=" & mserver & ";Initial Catalog=otpravka")
        IsServer = ""
        Dim command As New OleDb.OleDbCommand(queryString, oledbcon)
        oledbcon.Open()
        Dim reader As OleDb.OleDbDataReader = command.ExecuteReader()
        While reader.Read
            IsServer = Trim(reader(0).ToString)
        End While
        ' always call  

        reader.Close()
        oledbcon.Close()
    End Function
    Private Sub sendtopriem(ByVal theme As String, ByVal filevloz As String, ByVal tip As Integer, ByVal zzz As String, ByVal Server As String, ByRef Good As Boolean)
        Dim con As New SqlConnection _
        ("User Id=""aaad"";password=""3rokswick_yuginform"";Data Source=" & Server & ";Initial Catalog=otpravka")
        '("Server=" & Server & ";uid=<aaad>;pwd=<3rokswick_yuginform>;database=otpravka")

        Dim da As New SqlDataAdapter _
         ("Select * From priem", con)
        Dim MyCB As SqlCommandBuilder = New SqlCommandBuilder(da)
        Dim ds As New DataSet()
        '  MsgBox("Начинаем запись")
        Good = False
        Try
            da.MissingSchemaAction = MissingSchemaAction.AddWithKey

            Dim fs As New FileStream _
             (My.Application.Info.DirectoryPath & "\Tmp\" & filevloz, FileMode.OpenOrCreate, _
              FileAccess.Read)
            Dim MyData(fs.Length) As Byte
            'Dim MYDATA As String
            fs.Read(MyData, 0, fs.Length)
            Dim QQ As String
            QQ = System.Text.Encoding.Default.GetString(MyData)
            '   MsgBox(QQ)
            'fs.Read(MYDATA)
            fs.Close()
            ' MsgBox(MyData)
            con.Open()
            da.Fill(ds, "priem")
            Dim myRow As DataRow
            myRow = ds.Tables("priem").NewRow()
            myRow("datepriem") = zzz
            myRow("tip") = tip
            myRow("email") = theme
            myRow("file") = theme
            myRow("atcname") = filevloz
            myRow("atcfile") = QQ
            ds.Tables("priem").Rows.Add(myRow)
            da.Update(ds, "priem")

            fs = Nothing
            MyCB = Nothing
            ds = Nothing
            da = Nothing

            con.Close()
            con = Nothing
            Good = True
            '  MsgBox("Image saved to database")
            Exit Sub
        Catch ex As Exception
            MsgBox(ex.ToString)
            Exit Sub
        End Try
    End Sub
    Public Function FolderExists(ByVal Katalog As String) As Boolean
        Dim per As String
        per = Dir(Katalog, FileAttribute.Directory)
        If per <> "" Then
            FolderExists = True
        Else
            FolderExists = False
        End If
    End Function
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        Dim omle As OSPOP3_Plus.MessageListEntry
        Dim i As Integer
        Dim m As OSPOP3_Plus.Message
        Dim zzz As String
        Dim pppoe As String
        Dim mybody As String
        i = 1
        oSession.UseSSL = True
        oSession.OpenPOP3(txtServer.Text, Convert.ToInt32(txtPort.Text), txtLogin.Text, txtPassword.Text)
        For Each omle In oSession.MessageList
            m = oSession.GetMessageHeaders(i)
            If m.Subject = "IP" Then
                zzz = m.DateSent

                m = oSession.GetMessage(i, False)
                mybody = m.Body
                ' MsgBox(mybody)
                pppoe = "insert into priem (email, [file],tip,datepriem) values ('" & m.Sender.Address & "','" & mybody & "',1,'" & zzz & "')"
                m = oSession.GetMessage(i, True)
                IsServer(pppoe, "192.168.100.21")
            End If
            i = i + 1
        Next
        oSession.ClosePOP3()
        MsgBox("Сделано!!!")
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Try
            Dim omle As OSPOP3_Plus.MessageListEntry
            Dim i As Integer
            Dim m As OSPOP3_Plus.Message
            Dim good As Boolean
            Dim zzz As String
            Dim filevloz As String
            Dim tip As Integer
            Dim Myserver As String
            i = 1
            oSession.UseSSL = True
            Myserver = TxtSrv2.Text
            oSession.OpenPOP3(txtServer.Text, Convert.ToInt32(txtPort.Text), txtLogin.Text, txtPassword.Text)
            For Each omle In oSession.MessageList
                m = oSession.GetMessageHeaders(i)

                If UCase(m.Subject) = "MONBASE" Or UCase(m.Subject) = "MONBASEPFR" Or UCase(m.Subject) = "DAYDAY" Or UCase(m.Subject) = "DAYREG" Or UCase(m.Subject) = "DAYDAYPERSONAL" Then

                    zzz = m.DateSent
                    Select Case UCase(m.Subject)
                        Case "ALLBASE"
                            tip = 1
                        Case "DOBBASE"
                            tip = 2
                        Case "MONBASE"
                            tip = 3
                        Case "MONBASEPFR"
                            tip = 4
                        Case "DAYDAY"
                            tip = 11
                        Case "DAYREG"
                            tip = 111
                        Case "DAYDAYPERSONAL"
                            tip = 1111
                    End Select
                    m = oSession.GetMessage(i, False)

                    Dim a As OSPOP3_Plus.Attachment
                    For Each a In m.Attachments

                       
                        If FolderExists(My.Application.Info.DirectoryPath & "\Tmp") Then
                        Else
                            IO.Directory.CreateDirectory(My.Application.Info.DirectoryPath & "\Tmp")
                        End If
                        If FolderExists(My.Application.Info.DirectoryPath & "\Tmp2") Then
                        Else
                            IO.Directory.CreateDirectory(My.Application.Info.DirectoryPath & "\Tmp2")
                        End If

                        Dim fileName As String = ""
                        Dim attachmentCounter As Integer = 1
                        If a.AttachmentName <> "" Then
                            fileName = a.AttachmentName.Replace("""", "") 'attachment name may contain quotes!
                        Else
                            fileName = "attachment_" + attachmentCounter.ToString() 'file name can't be blank
                            If a.ContentType = "message/rfc822" Then
                                fileName = fileName + ".eml"
                            End If

                        End If

                        a.Save(My.Application.Info.DirectoryPath & "\Tmp\" & fileName)
                        '  MsgBox(My.Application.Info.DirectoryPath)

                        filevloz = fileName
                        'pppoe = "insert into priem (email, [file],tip,datepriem,atcname,atcfile) values ('" & m.Sender.Address & "','" & m.Sender.Address & "'," & tip & ",'" & zzz & "','" & filevloz & "',)"

                        'IsServer(pppoe, "192.168.100.205")
                        ' MsgBox(fileName)


                        Call sendtopriem(m.Sender.Address, filevloz, tip, zzz, Myserver, good)
                        'Exit For
                        
                    Next
                    If good = True Then
                        ' MsgBox("recorded")
                        m = oSession.GetMessage(i, True)
                        ' MsgBox("OSPPOP DELETED")
                        'On Error Resume Next
                        Kill(My.Application.Info.DirectoryPath & "\Tmp\" & filevloz)


                    End If
                End If
                i = i + 1
            Next
            oSession.ClosePOP3()
            MsgBox("Сделано!!!")
        Catch ex As Exception
            MsgBox(ex.ToString)

        End Try
    End Sub

    Private Sub txtLogin_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtLogin.TextChanged

    End Sub
End Class
...
Рейтинг: 0 / 0
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38762364
Фотография Konst_One
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
OSPOP3_Plus - это случаем не контрол?
...
Рейтинг: 0 / 0
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38762366
Фотография Konst_One
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
если контрол, то в сервисе не будет работать
...
Рейтинг: 0 / 0
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38762397
crazyara
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
вот отсюда скачал http://www.ostrosoft.com/ospop3.aspx , с сайта разработчика
а как узнать контрол он или нет
...
Рейтинг: 0 / 0
Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
    #38762424
Фотография Konst_One
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
reference в проект на эту бибилиотеку добавили?
...
Рейтинг: 0 / 0
25 сообщений из 31, страница 1 из 2
Форумы / WinForms, .Net Framework [игнор отключен] [закрыт для гостей] / Ошибка службыSystem.NullReferenceException:В экземпляре объекта не задана ссылка на объект
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]