Click here to Skip to main content
15,850,685 members
Home / Discussions / C#
   

C#

 
GeneralRe: Help with Listbox and comboBox Pin
Sascha Lefèvre26-Apr-16 6:12
professionalSascha Lefèvre26-Apr-16 6:12 
QuestionHow to get/set SharePoint 2013 MySite properties through API? Pin
Coding Eyes25-Apr-16 0:32
Coding Eyes25-Apr-16 0:32 
AnswerRe: How to get/set SharePoint 2013 MySite properties through API? Pin
Eddy Vluggen25-Apr-16 4:12
professionalEddy Vluggen25-Apr-16 4:12 
QuestionHow to get selected item data of listView Column Item? Pin
0HourCoder23-Apr-16 10:36
0HourCoder23-Apr-16 10:36 
AnswerRe: How to get selected item data of listView Column Item? Pin
Sascha Lefèvre23-Apr-16 10:59
professionalSascha Lefèvre23-Apr-16 10:59 
GeneralRe: How to get selected item data of listView Column Item? Pin
0HourCoder23-Apr-16 11:25
0HourCoder23-Apr-16 11:25 
AnswerRe: How to get selected item data of listView Column Item? Pin
Simon_Whale23-Apr-16 23:24
Simon_Whale23-Apr-16 23:24 
QuestionI have this code that scans the memory of a program, the more programs that precision much memory takes a long time !! Any faster jeito to do this? Pin
Member 1248006323-Apr-16 6:46
Member 1248006323-Apr-16 6:46 
C#
SYSTEM_INFO sys_info = new SYSTEM_INFO();
            GetSystemInfo(out sys_info);

            IntPtr proc_min_address = sys_info.minimumApplicationAddress;
            IntPtr proc_max_address = sys_info.maximumApplicationAddress;

            // salvar os valores como inteiros longos por isso não vou ter que fazer um monte de moldes mais tarde
            long proc_min_address_l = (long)proc_min_address;
            long proc_max_address_l = (long)proc_max_address;

            // Abrir o processo com nível de acesso desejado
            IntPtr processHandle = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_WM_READ, false, process.Id);

            // este irá armazenar qualquer informação que recebemos de VirtualQueryEx()
            MEMORY_BASIC_INFORMATION mem_basic_info = new MEMORY_BASIC_INFORMATION();

            int bytesRead = 0;  // Com o número de bytes ler ReadProcessMemory

            string arquivoName = string.Format(@"Dumps\Dump_{0}_{1:dd_MM_yyyy HH_mm_ss}.txt", process.ProcessName, DateTime.Now);
            using (FileStream fs = File.Create(arquivoName))
            {
                using (StreamWriter sw = new StreamWriter(fs))
                {
                    while (proc_min_address_l < proc_max_address_l)
                    {
                        // 28 = sizeof(MEMORY_BASIC_INFORMATION)
                        VirtualQueryEx(processHandle, proc_min_address, out mem_basic_info, (uint)Marshal.SizeOf(typeof(MEMORY_BASIC_INFORMATION)));

                        // Se este pedaço de memória é acessível
                        if (mem_basic_info.Protect == PAGE_READWRITE && mem_basic_info.State == MEM_COMMIT)
                        {
                            byte[] buffer = new byte[mem_basic_info.RegionSize];

                            // ler tudo no tampão atrás referido
                            ReadProcessMemory((int)processHandle, mem_basic_info.BaseAddress, buffer, mem_basic_info.RegionSize, ref bytesRead);

                            string info = string.Empty;
                            // Em seguida, a este arquivo de saída
                            for (int i = 0; i < mem_basic_info.RegionSize; i++)
                            {
                                if ((char)buffer[i] != '\0')
                                {
                                    string buf = string.Concat((char)buffer[i]);
                                    string pattern = @"(\d|=|\s)";
                                    Match match = new Regex(pattern).Match(buf);

                                    if (match.Success)
                                        info = string.Format("{0}{1}", info, buf);
                                }
                            }

                            sw.WriteLine(info);
                        }
                        // ir para o próximo pedaço de memória
                        proc_min_address_l += mem_basic_info.RegionSize;
                        proc_min_address = new IntPtr(proc_min_address_l);
                    }
                    sw.Close();
                }
            }
        }

AnswerRe: I have this code that scans the memory of a program, the more programs that precision much memory takes a long time !! Any faster jeito to do this? Pin
OriginalGriff23-Apr-16 6:57
mveOriginalGriff23-Apr-16 6:57 
Questionhow do I get the information from a site of a button? Pin
Member 1248006323-Apr-16 6:12
Member 1248006323-Apr-16 6:12 
QuestionRe: how do I get the information from a site of a button? Pin
CHill6023-Apr-16 6:15
mveCHill6023-Apr-16 6:15 
AnswerRe: how do I get the information from a site of a button? Pin
Member 1248006323-Apr-16 6:28
Member 1248006323-Apr-16 6:28 
AnswerRe: how do I get the information from a site of a button? Pin
OriginalGriff23-Apr-16 6:30
mveOriginalGriff23-Apr-16 6:30 
GeneralRe: how do I get the information from a site of a button? Pin
Member 1248006323-Apr-16 6:35
Member 1248006323-Apr-16 6:35 
GeneralRe: how do I get the information from a site of a button? Pin
CHill6023-Apr-16 6:38
mveCHill6023-Apr-16 6:38 
GeneralRe: how do I get the information from a site of a button? Pin
OriginalGriff23-Apr-16 6:44
mveOriginalGriff23-Apr-16 6:44 
GeneralRe: how do I get the information from a site of a button? Pin
Member 1248006323-Apr-16 6:46
Member 1248006323-Apr-16 6:46 
Questionc# complex dictionary: can modify value in for-loop: thought you couldn't do that Pin
BillWoodruff23-Apr-16 1:10
professionalBillWoodruff23-Apr-16 1:10 
AnswerRe: c# complex dictionary: can modify value in for-loop: thought you couldn't do that Pin
OriginalGriff23-Apr-16 1:24
mveOriginalGriff23-Apr-16 1:24 
GeneralRe: c# complex dictionary: can modify value in for-loop: thought you couldn't do that Pin
BillWoodruff23-Apr-16 3:20
professionalBillWoodruff23-Apr-16 3:20 
GeneralOT: Our mutually increasing decrepitude Pin
OriginalGriff23-Apr-16 3:29
mveOriginalGriff23-Apr-16 3:29 
GeneralRe: c# complex dictionary: can modify value in for-loop: thought you couldn't do that Pin
Richard Deeming23-Apr-16 4:39
mveRichard Deeming23-Apr-16 4:39 
QuestionHow to wait to execute for next process till current process complete using C# Process Object Pin
Tej_dev22-Apr-16 6:32
Tej_dev22-Apr-16 6:32 
AnswerRe: How to wait to execute for next process till current process complete using C# Process Object Pin
Richard Deeming22-Apr-16 6:44
mveRichard Deeming22-Apr-16 6:44 
GeneralRe: How to wait to execute for next process till current process complete using C# Process Object Pin
Tej_dev22-Apr-16 7:11
Tej_dev22-Apr-16 7:11 

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.