Question : Restricting offsite shrepoint users from accessing network drives on SBS server

Hi Experts,

I have setup our company intranet using sharepoint.  This works fine for the office which houses the SBS 2003 server.  We have another office that is not connected into our SBS server, so I have created a test user name and password on the SBS server for them so they can login over the internet to sharepoint.  This all works fine when they are just using sharepoint.

The problem I am having is that we have created some training file's which have several html files and I have just put them into a folder on one of the drives of the sbs server -//servername/drivename/training/filenames. To access these files we have used a link in sharepoint. This means that is they are smart enough(which I doubt) they can just type in //servername/drivename and access the rest of the drive.

I am hoping someone can steer me in the right direction of either putting the HTML files on sharepoint so we don't have to link back to a network drvie and/or setting up user permission on the SBS server and sharepoint.

Thanks

Roofin

Answer : Restricting offsite shrepoint users from accessing network drives on SBS server

Hi,

Please check link for solution:
http://niitdeveloper.blogspot.com/2010/07/display-image-instead-of-checkbox-in.html.

Here you can download the project for the same.

Here is the code snippet of the file Form1.cs:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Collections;

namespace ee_DataGrid
{
   public partial class Form1 : Form
   {
       // gridViewData is the name of the DataGridView
       private Bitmap trueImg, falseImg;
       public Form1()
       {
           InitializeComponent();

           trueImg = (Bitmap)Image.FromFile(Application.StartupPath + @"\Images\true.png");
           falseImg = (Bitmap)Image.FromFile(Application.StartupPath + @"\Images\false.png");
           
           // Sorting image with this event
           gridViewData.ColumnHeaderMouseClick += new DataGridViewCellMouseEventHandler(gridViewData_ColumnHeaderMouseClick);
       }      

       private void btnGetData_Click(object sender, EventArgs e)
       {
           try
           {
               #region Filling DataGridView named gridViewData values
               String connectionString = "Initial Catalog=TestDB;Data Source=localhost; Uid=sa; pwd=god";
               SqlDataAdapter dataAdapter = new SqlDataAdapter("SELECT * FROM UID", connectionString);
               SqlCommandBuilder commandBuilder = new SqlCommandBuilder(dataAdapter);

               DataTable table = new DataTable();
               dataAdapter.Fill(table);
               gridViewData.DataSource = table;
               gridViewData.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);                

               #endregion

               #region Showing image instead of checkbox

               // Hiding checkbox values
               gridViewData.Columns["Is Indian"].Visible = false;

               DataGridViewImageColumn imageCol = new DataGridViewImageColumn();
               imageCol.Name = "Is Indian";
               imageCol.SortMode = DataGridViewColumnSortMode.Automatic;
               gridViewData.Columns.Add(imageCol);
               
               foreach (DataGridViewRow row in gridViewData.Rows)
               {
                   if (row.Cells["Is Indian"].Value != null)
                   {
                       if (Convert.ToBoolean(row.Cells["Is Indian"].Value))
                       {
                           // Cells[3] is the position of the cell in the row
                           row.Cells[3].Value = trueImg;
                       }
                       else
                       {
                           row.Cells[3].Value = falseImg;                            
                        }
                   }
               }
               #endregion
           }
           catch (Exception exc)
           {
               MessageBox.Show("Contact Developer\nTechnical Report: " + exc.ToString());
           }
       }

       void gridViewData_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
       {
           foreach (DataGridViewRow row in gridViewData.Rows)
           {
               if (row.Cells["Is Indian"].Value != null)
               {
                   if (Convert.ToBoolean(row.Cells["Is Indian"].Value))
                   {
                       // Cells[3] is the position of the cell in the row
                       row.Cells[3].Value = trueImg;
                   }
                   else
                   {
                       row.Cells[3].Value = falseImg;
                   }
               }
           }
       }
   }
}

Do write back for more explanation and help.


Random Solutions  
 
programming4us programming4us