Click here to Skip to main content
15,915,734 members
Home / Discussions / C#
   

C#

 
GeneralRe: DirectoryInfo.GetFiles with multiple file filters Pin
Judah Gabriel Himango17-Aug-06 7:35
sponsorJudah Gabriel Himango17-Aug-06 7:35 
Questionproblems using System.Diagnosics.Process.Start to start Process Pin
3Dizard17-Aug-06 5:37
3Dizard17-Aug-06 5:37 
AnswerRe: problems using System.Diagnosics.Process.Start to start Process Pin
Judah Gabriel Himango17-Aug-06 6:04
sponsorJudah Gabriel Himango17-Aug-06 6:04 
GeneralRe: problems using System.Diagnosics.Process.Start to start Process Pin
3Dizard17-Aug-06 7:14
3Dizard17-Aug-06 7:14 
AnswerRe: problems using System.Diagnosics.Process.Start to start Process Pin
Ennis Ray Lynch, Jr.17-Aug-06 6:22
Ennis Ray Lynch, Jr.17-Aug-06 6:22 
GeneralRe: problems using System.Diagnosics.Process.Start to start Process Pin
3Dizard17-Aug-06 7:19
3Dizard17-Aug-06 7:19 
AnswerRe: problems using System.Diagnosics.Process.Start to start Process Pin
Judah Gabriel Himango17-Aug-06 9:30
sponsorJudah Gabriel Himango17-Aug-06 9:30 
GeneralRe: problems using System.Diagnosics.Process.Start to start Process Pin
3Dizard17-Aug-06 12:06
3Dizard17-Aug-06 12:06 
AnswerRe: problems using System.Diagnosics.Process.Start to start Process Pin
Mike Bluett17-Aug-06 12:01
Mike Bluett17-Aug-06 12:01 
GeneralRe: problems using System.Diagnosics.Process.Start to start Process Pin
3Dizard17-Aug-06 12:18
3Dizard17-Aug-06 12:18 
QuestionCOM+ help Pin
jaltiere17-Aug-06 5:23
jaltiere17-Aug-06 5:23 
QuestionFile update in access not working Pin
Vodstok17-Aug-06 5:03
Vodstok17-Aug-06 5:03 
AnswerRe: File update in access not working Pin
Guffa17-Aug-06 6:16
Guffa17-Aug-06 6:16 
Questionsending file to printer [modified] Pin
Support12317-Aug-06 4:45
Support12317-Aug-06 4:45 
AnswerRe: sending file to printer Pin
Mike Bluett17-Aug-06 12:12
Mike Bluett17-Aug-06 12:12 
QuestionUSB or parallel Pin
clayton.curmi17-Aug-06 4:29
clayton.curmi17-Aug-06 4:29 
AnswerRe: USB or parallel Pin
Dave Kreskowiak17-Aug-06 4:55
mveDave Kreskowiak17-Aug-06 4:55 
Questionconnecting to named instance SQL Server through C# Pin
Abhijeet Ballal17-Aug-06 4:26
Abhijeet Ballal17-Aug-06 4:26 
AnswerRe: connecting to named instance SQL Server through C# [modified] Pin
Professor Sharada Ulhas17-Aug-06 5:05
Professor Sharada Ulhas17-Aug-06 5:05 
QuestionEditing a string Pin
Anthony Mushrow17-Aug-06 4:04
professionalAnthony Mushrow17-Aug-06 4:04 
AnswerRe: Editing a string Pin
Le centriste17-Aug-06 4:12
Le centriste17-Aug-06 4:12 
AnswerRe: Editing a string [modified] Pin
Professor Sharada Ulhas17-Aug-06 5:10
Professor Sharada Ulhas17-Aug-06 5:10 
AnswerRe: Editing a string Pin
Dustin Metzgar17-Aug-06 5:31
Dustin Metzgar17-Aug-06 5:31 
QuestionMacro to refresh solution explorer's folder Pin
Marco225017-Aug-06 3:34
Marco225017-Aug-06 3:34 
Hi all.

Does anyone know how I can refresh a folder (like App_References) in solution explorer using a macro?

This because I'd wrote a macro that refresh automatically all web references. But after this, the solution explorer don't show web service related files (.dico, .discomap, etc).

The macro:
[code]
Option Explicit On

Imports System
Imports EnvDTE
Imports EnvDTE80
Imports System.Diagnostics
Imports System.IO
Imports VSLangProj
Imports System.net

Public Module Macros
Sub UpdateWebReferences()
Dim vswebsite As VsWebSite.VSWebSite
Dim vswebsiteRefs As New System.Collections.ArrayList

For i As Integer = 1 To DTE.Solution.Projects.Count
'MsgBox(Microsoft.VisualBasic.Information.TypeName(DTE.Solution.Projects.Item(i).Object))

'Change this with full web project path
If "C:\Projetos\Internos\SmartSeguro\Code\Seguro.Web\" = DTE.Solution.Projects.Item(i).Name Then
vswebsite = CType(DTE.Solution.Projects.Item(i).Object, VsWebSite.VSWebSite)
'vswebsite.p()

For j As Integer = 1 To vswebsite.WebReferences.Count
Dim webRef As VsWebSite.WebReference = vswebsite.WebReferences.Item(j)
Dim wsPath As String = Path.GetDirectoryName(webRef.ProjectItem.FileNames(0))

Dim item As New WebServiceItem
item.url = webRef.ServiceLocationUrl
item.nNameSpace = webRef.Namespace
item.dirPath = wsPath
item.serviceName = webRef.ServiceName
item.ReadWsdl()

Dim fs As New FileStream(wsPath + "\" & webRef.ServiceName & ".disco", FileMode.Open)
Dim teste() As Byte
ReDim teste(fs.Length - 1)
fs.Read(teste, 0, fs.Length)
fs.Close()
item.disco = New MemoryStream(teste)

fs = New FileStream(wsPath + "\" & webRef.ServiceName & ".discomap", FileMode.Open)
Dim teste2() As Byte
ReDim teste2(fs.Length - 1)
fs.Read(teste2, 0, fs.Length)
fs.Close()
item.discoMap = New MemoryStream(teste2)

vswebsiteRefs.Add(item)
webRef.Remove()
Directory.Delete(wsPath)

If vswebsite.WebReferences.Count = 0 Then
Exit For
End If

j = 0
Next

For j As Integer = 0 To vswebsiteRefs.Count - 1
Dim webRef As WebServiceItem = vswebsiteRefs(j)

Directory.CreateDirectory(webRef.dirPath)

Dim fs As New FileStream(webRef.dirPath + "\" + webRef.serviceName + ".disco", FileMode.Create)
fs.Write(webRef.disco.ToArray(), 0, webRef.disco.Length)
fs.Close()

fs = New FileStream(webRef.dirPath + "\" + webRef.serviceName + ".discomap", FileMode.Create)
fs.Write(webRef.discoMap.ToArray(), 0, webRef.discoMap.Length)
fs.Close()

fs = New FileStream(webRef.dirPath + "\" + webRef.serviceName + ".wsdl", FileMode.Create)
fs.Write(webRef.wsdl.ToArray(), 0, webRef.wsdl.Length)
fs.Close()

vswebsite.WebReferences.Add(webRef.url, webRef.nNameSpace)
Next

'Implementar: Refresh na pasta.
For j As Integer = 1 To vswebsite.Project.ProjectItems.Count
If vswebsite.Project.ProjectItems.Item(3).Name = "App_WebReferences" Then
End If
Next

Exit For
End If
Next
End Sub
End Module

Class WebServiceItem
Public url As String
Public nNameSpace As String
Public dirPath As String
Public serviceName As String

Public disco As New MemoryStream
Public discoMap As New MemoryStream
Public wsdl As New MemoryStream

Public Sub ReadWsdl()
Dim wr As HttpWebRequest = WebRequest.Create(url & "?WSDL")
Dim sr As New StreamReader(wr.GetResponse().GetResponseStream(), System.Text.Encoding.GetEncoding(1252))

Dim teste2 As String = sr.ReadToEnd()
sr.Close()
Dim teste() As Byte = System.Text.Encoding.ASCII.GetBytes(teste2)

wsdl.Write(teste, 0, teste.Length)
End Sub
End Class

[/code]

QuestionFirst cold startup time Pin
Super Lloyd17-Aug-06 2:45
Super Lloyd17-Aug-06 2:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.