Click here to Skip to main content
15,887,304 members
Home / Discussions / C#
   

C#

 
GeneralRe: Help with Listbox and comboBox Pin
Sascha Lefèvre26-Apr-16 5:12
professionalSascha Lefèvre26-Apr-16 5:12 
QuestionHow to get/set SharePoint 2013 MySite properties through API? Pin
Coding Eyes24-Apr-16 23:32
Coding Eyes24-Apr-16 23:32 
AnswerRe: How to get/set SharePoint 2013 MySite properties through API? Pin
Eddy Vluggen25-Apr-16 3:12
professionalEddy Vluggen25-Apr-16 3:12 
QuestionHow to get selected item data of listView Column Item? Pin
0HourCoder23-Apr-16 9:36
0HourCoder23-Apr-16 9:36 
AnswerRe: How to get selected item data of listView Column Item? Pin
Sascha Lefèvre23-Apr-16 9:59
professionalSascha Lefèvre23-Apr-16 9:59 
GeneralRe: How to get selected item data of listView Column Item? Pin
0HourCoder23-Apr-16 10:25
0HourCoder23-Apr-16 10:25 
AnswerRe: How to get selected item data of listView Column Item? Pin
Simon_Whale23-Apr-16 22:24
Simon_Whale23-Apr-16 22: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 5:46
Member 1248006323-Apr-16 5: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 5:57
mveOriginalGriff23-Apr-16 5:57 
Questionhow do I get the information from a site of a button? Pin
Member 1248006323-Apr-16 5:12
Member 1248006323-Apr-16 5:12 
QuestionRe: how do I get the information from a site of a button? Pin
CHill6023-Apr-16 5:15
mveCHill6023-Apr-16 5:15 
AnswerRe: how do I get the information from a site of a button? Pin
Member 1248006323-Apr-16 5:28
Member 1248006323-Apr-16 5:28 
AnswerRe: how do I get the information from a site of a button? Pin
OriginalGriff23-Apr-16 5:30
mveOriginalGriff23-Apr-16 5:30 
GeneralRe: how do I get the information from a site of a button? Pin
Member 1248006323-Apr-16 5:35
Member 1248006323-Apr-16 5:35 
GeneralRe: how do I get the information from a site of a button? Pin
CHill6023-Apr-16 5:38
mveCHill6023-Apr-16 5:38 
GeneralRe: how do I get the information from a site of a button? Pin
OriginalGriff23-Apr-16 5:44
mveOriginalGriff23-Apr-16 5:44 
GeneralRe: how do I get the information from a site of a button? Pin
Member 1248006323-Apr-16 5:46
Member 1248006323-Apr-16 5:46 
Questionc# complex dictionary: can modify value in for-loop: thought you couldn't do that Pin
BillWoodruff23-Apr-16 0:10
professionalBillWoodruff23-Apr-16 0:10 
AnswerRe: c# complex dictionary: can modify value in for-loop: thought you couldn't do that Pin
OriginalGriff23-Apr-16 0:24
mveOriginalGriff23-Apr-16 0:24 
GeneralRe: c# complex dictionary: can modify value in for-loop: thought you couldn't do that Pin
BillWoodruff23-Apr-16 2:20
professionalBillWoodruff23-Apr-16 2:20 
GeneralOT: Our mutually increasing decrepitude Pin
OriginalGriff23-Apr-16 2:29
mveOriginalGriff23-Apr-16 2:29 
GeneralRe: c# complex dictionary: can modify value in for-loop: thought you couldn't do that Pin
Richard Deeming23-Apr-16 3:39
mveRichard Deeming23-Apr-16 3:39 
QuestionHow to wait to execute for next process till current process complete using C# Process Object Pin
Tej_dev22-Apr-16 5:32
Tej_dev22-Apr-16 5:32 
AnswerRe: How to wait to execute for next process till current process complete using C# Process Object Pin
Richard Deeming22-Apr-16 5:44
mveRichard Deeming22-Apr-16 5:44 
GeneralRe: How to wait to execute for next process till current process complete using C# Process Object Pin
Tej_dev22-Apr-16 6:11
Tej_dev22-Apr-16 6: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.